/**
 * Nobregas MySQL Panel - Custom CSS
 * Follows NOBREGAS_STYLE_GUIDE.md
 */

/* ─── Body / Base ─── */
body {
    background: #030712;
    color: #e5e7eb;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ─── Noise Texture Overlay ─── */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ─── Glass Card Utility ─── */
.glass-dark {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Gradient Text ─── */
.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Button Ripple ─── */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}
.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.25);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.45);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.25) transparent;
}

/* ─── Selection ─── */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* ─── Focus Visible ─── */
*:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── Reveal Animation ─── */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}
@media (max-width: 640px) {
    .reveal-element {
        transform: translateY(20px);
    }
}

/* Staggered children */
.reveal-element:nth-child(2) { transition-delay: 0.1s; }
.reveal-element:nth-child(3) { transition-delay: 0.2s; }
.reveal-element:nth-child(4) { transition-delay: 0.3s; }
.reveal-element:nth-child(5) { transition-delay: 0.4s; }
.reveal-element:nth-child(6) { transition-delay: 0.5s; }

/* ─── Nav Scrolled State ─── */
.nav-scrolled {
    background: rgba(10, 15, 30, 0.85) !important;
    backdrop-filter: blur(20px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(130%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ─── Toast Slide Animation ─── */
@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
.toast-enter {
    animation: toast-slide-in 0.3s ease-out forwards;
}
.toast-exit {
    animation: toast-slide-out 0.3s ease-in forwards;
}

/* ─── Loading Spinner Override ─── */
@keyframes spin-slow {
    to { transform: rotate(360deg); }
}
.loading-spinner {
    animation: spin-slow 1s linear infinite;
}

/* ─── Code / Query Editor ─── */
.sql-editor {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    tab-size: 4;
    line-height: 1.6;
    resize: vertical;
}

/* ─── Table Responsive ─── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── Pricing Card Hover Lift ─── */
.pricing-card > div:last-child {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease;
}
.pricing-card:hover > div:last-child {
    transform: translateY(-8px);
}

/* ─── Page Transition ─── */
.page-fade-enter {
    opacity: 0;
    transform: translateY(10px);
}
.page-fade-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ─── Tooltip ─── */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #1a2332;
    color: #e5e7eb;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}
[data-tooltip]:hover::after {
    opacity: 1;
}
