@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

.font-display { font-family: 'Cinzel', serif; }
.font-serif { font-family: 'Playfair Display', serif; }

body {
    background-color: var(--black);
    background-image: radial-gradient(circle at top center, #1F1512 0%, #000000 100%);
    color: var(--gold-light);
}

[data-theme="light"] body {
    background-color: #f5f0e6;
    background-image: radial-gradient(circle at top center, #ebe5d9 0%, #e8e0d2 100%);
    color: #5C2329;
}

#ash-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

[data-theme="light"] #ash-canvas { opacity: 0.35; }

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glass-panel {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 30px rgba(0,0,0,0.5);
}

[data-theme="light"] .glass-panel {
    background: linear-gradient(165deg, #fdfbf7, #f8f4ec, #f5f0e6);
    border-color: rgba(184, 150, 46, 0.35) !important;
}

:root {
    --nav-height: 4rem; /* matches nav h-16 */
}
@media (min-width: 1024px) {
    :root { --nav-height: 5rem; } /* matches nav lg:h-20 */
}

main {
    position: relative;
    z-index: 10;
    /* Clear fixed nav; !important beats Tailwind py-* utilities on <main> */
    padding-top: calc(var(--nav-height) + 2rem) !important;
    padding-bottom: 3rem;
}

::selection {
    background: var(--accent, var(--gold));
    color: black;
}

/* Nav */
.nav-link {
    color: rgba(212, 175, 55, 0.6);
    transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: #D4AF37;
}
.nav-link.active {
    border-bottom: 2px solid #D4AF37;
    box-shadow: 0 10px 20px -10px rgba(212, 175, 55, 0.5);
}

[data-theme="light"] .nav-link { color: rgba(92, 35, 41, 0.7); }
[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active { color: #5C2329; }

/* Nav dropdowns */
.nav-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    padding-top: 0.5rem;
    min-width: 220px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown.is-open .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown-menu {
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    padding: 0.5rem 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.nav-dropdown.is-open .nav-dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-chevron {
    transition: transform 0.2s;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
}

/* Admin badge in main nav */
.admin-nav-badge {
    display: inline-flex;
    align-items: center;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #030303;
    background: linear-gradient(135deg, #D4AF37, #b8982e);
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
    white-space: nowrap;
}
.admin-nav-badge--sm {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    letter-spacing: 0.08em;
}
[data-theme="light"] .admin-nav-badge {
    color: #f5f0e6;
}

/* Profile dropdown in nav */
.nav-profile-dropdown .nav-profile-panel {
    right: 0;
    left: auto;
    min-width: 220px;
}
.nav-profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.35);
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #D4AF37;
}
.nav-profile-toggle:hover .nav-profile-avatar {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}
.dropdown-profile-header {
    margin-bottom: 0.25rem;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: rgba(249, 241, 216, 0.8);
    transition: background 0.2s, color 0.2s;
}
.dropdown-item:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
}

[data-theme="light"] .dropdown-item {
    color: rgba(92, 35, 41, 0.85);
}
[data-theme="light"] .dropdown-item:hover {
    color: #5C2329;
}

.mobile-nav-link {
    padding: 0.5rem 0;
    color: rgba(212, 175, 55, 0.8);
}
.mobile-nav-link:hover { color: #D4AF37; }

/* Buttons */
.btn-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #D4AF37, #b8982e);
    color: #030303;
    border: none;
    border-radius: 2px;
    transition: filter 0.2s, box-shadow 0.2s;
}
.btn-gold:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    color: #030303;
}

.btn-gold-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    background: transparent;
    color: #D4AF37;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 2px;
    transition: background 0.2s, box-shadow 0.2s;
}
.btn-gold-outline:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    color: #D4AF37;
}

/* Inputs */
.input-lux {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: white;
    font-family: 'Playfair Display', serif;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input-lux:focus {
    border-color: var(--accent, var(--gold));
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

[data-theme="light"] .input-lux {
    background: #f0ebe0;
    border-color: rgba(184, 150, 46, 0.35);
    color: #5C2329;
}

/* Theme toggle */
.theme-switch-wrap { position: relative; z-index: 100; }

.theme-toggle {
    position: relative;
    width: 4.5rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.12);
    cursor: pointer;
    padding: 0;
}

.theme-knob {
    position: absolute;
    top: 0.325rem;
    left: 0.25rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37, #b8982e);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .theme-knob { transform: translateX(2.5rem); }

.theme-icon-dark, .theme-icon-light {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    opacity: 0.5;
}
.theme-icon-dark { left: 0.5rem; }
.theme-icon-light { right: 0.5rem; }

/* Cards */
.spotlight-card {
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.spotlight-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
}

[data-theme="light"] .spotlight-card {
    background: linear-gradient(165deg, #fdfbf7, #f8f4ec);
    color: #5C2329;
}

.pricing-card {
    position: relative;
    overflow: hidden;
}
.pricing-card.featured {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.2);
}
.pricing-card .badge-featured {
    position: absolute;
    top: 1rem;
    right: -2rem;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #D4AF37, #8a7326);
    color: #030303;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    padding: 0.25rem 2.5rem;
    letter-spacing: 0.1em;
}

/* Docs */
.doc-sidebar {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}
.doc-sidebar .nav-link-doc {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    color: rgba(212, 175, 55, 0.6);
    border-left: 2px solid transparent;
}
.doc-sidebar .nav-link-doc:hover,
.doc-sidebar .nav-link-doc.active {
    color: #D4AF37;
    border-left-color: #D4AF37;
}

/* Account sidebar */
.account-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
    align-self: flex-start;
}
.account-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: rgba(212, 175, 55, 0.6);
    border-left: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.account-nav-link:hover,
.account-nav-link.active {
    color: #D4AF37;
    border-left-color: #D4AF37;
    background: rgba(212, 175, 55, 0.06);
}
[data-theme="light"] .account-nav-link { color: rgba(92, 35, 41, 0.7); }
[data-theme="light"] .account-nav-link:hover,
[data-theme="light"] .account-nav-link.active { color: #5C2329; }

.method-badge {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-weight: bold;
}
.method-get { background: rgba(22, 163, 74, 0.2); color: #16a34a; }
.method-post { background: rgba(29, 78, 216, 0.2); color: #1d4ed8; }

.callout-gold {
    border-left: 3px solid #D4AF37;
    background: rgba(212, 175, 55, 0.08);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

@keyframes pulseSlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.animate-pulse-slow { animation: pulseSlow 4s ease-in-out infinite; }

.text-gradient-gold {
    background: linear-gradient(90deg, #8a7326, #D4AF37, #F9F1D8, #D4AF37, #8a7326);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
}
@keyframes shine {
    to { background-position: 200% center; }
}

.text-shadow-glow { text-shadow: 0 0 20px rgba(212, 175, 55, 0.4); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.4); }
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.6);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent, var(--gold)); }
* { scrollbar-width: thin; scrollbar-color: rgba(212, 175, 55, 0.7) rgba(0, 0, 0, 0.4); }

/* Alerts */
.alert-error {
    background: rgba(185, 28, 28, 0.15);
    border: 1px solid rgba(185, 28, 28, 0.4);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 2px;
    margin-bottom: 1rem;
}
.alert-success {
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.4);
    color: #86efac;
    padding: 0.75rem 1rem;
    border-radius: 2px;
    margin-bottom: 1rem;
}

/* Intro overlay */
#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #030303;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#intro-overlay .intro-brand {
    font-family: 'Cinzel', serif;
    font-size: clamp(28px, 6vw, 52px);
    color: #D4AF37;
    letter-spacing: 0.2em;
}
.intro-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    width: 0;
    max-width: 300px;
    margin: 1.5rem auto;
}

@media (hover: none) {
    .theme-toggle { min-width: 44px; min-height: 44px; }
}
