/* ===== PeerCritiq Design System ===== */

:root {
    --bg-deep: #0f0f0f;
    --bg-body: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-card-hover: #252525;
    --border-subtle: #2a2a2a;
    --border-hover: #3a3a3a;
    --gold: #f0b429;
    --gold-light: #f5c542;
    --gold-glow: rgba(240, 180, 41, 0.15);
    --sage: #5ab5a0;
    --error: #e74c3c;
    --text-heading: #f5f5f5;
    --text-body: #e8e6e3;
    --text-muted: #8a8a8a;
    --text-placeholder: #5a5a5a;
}

/* ===== Grain Texture Overlay ===== */
.grain-overlay {
    position: relative;
}
.grain-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    pointer-events: none;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
    z-index: 1;
}
.grain-overlay > * {
    position: relative;
    z-index: 2;
}

/* ===== Gold Glow Effect ===== */
.gold-glow-hover {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.gold-glow-hover:hover {
    box-shadow: 0 0 24px var(--gold-glow);
    border-color: var(--border-hover);
}

/* ===== Glass Morphism ===== */
.glass {
    background: rgba(15, 15, 15, 0.75);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

/* ===== Fade-in Animation ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ===== Staggered Card Animations ===== */
@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.stagger { animation: staggerIn 0.5s ease-out both; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}
html {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #1a1a1a;
}

/* ===== Input Focus Glow ===== */
.input-focus-glow:focus {
    box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ===== HTMX Loading Indicator ===== */
.htmx-indicator {
    display: none;
    color: var(--text-muted);
}
.htmx-request .htmx-indicator {
    display: inline-block;
}
.htmx-request.htmx-indicator {
    display: inline-block;
}

/* ===== Selection Color ===== */
::selection {
    background: rgba(240, 180, 41, 0.3);
    color: #f5f5f5;
}

/* ===== Decorative Gold Line ===== */
.gold-line {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 2px;
}
