/* Vaidika Vignanam - Modern Sacred Vedic Design System */

:root {
    --bg-deep: #080402;
    --bg-card: rgba(22, 11, 6, 0.8);
    --bg-glass: rgba(35, 18, 10, 0.7);
    --border-gold: rgba(212, 175, 55, 0.28);
    --border-hover: rgba(245, 158, 11, 0.6);
    --gold-primary: #f59e0b;
    --gold-light: #fde68a;
    --gold-shimmer: #d4af37;
    --saffron: #ea580c;
    --saffron-light: #fdba74;
    --text-main: #fdfaf4;
    --text-muted: #d1b89d;
    --text-verse: #fffbf0;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.75);
    --glow: 0 0 25px rgba(245, 158, 11, 0.25);
    --font-base: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-sacred: 'Times New Roman', Times, 'Georgia', serif;
    --verse-scale: 1.2rem;
    --verse-line-height: 2.1;
}

[data-theme="saffron"] {
    --bg-deep: #190701;
    --bg-card: rgba(45, 17, 7, 0.85);
    --bg-glass: rgba(62, 24, 10, 0.75);
    --border-gold: rgba(249, 115, 22, 0.38);
    --gold-primary: #fb923c;
    --gold-light: #ffedd5;
    --gold-shimmer: #f97316;
    --text-main: #fff7ed;
    --text-muted: #fed7aa;
    --text-verse: #ffffff;
}

[data-theme="light"] {
    --bg-deep: #faf5ed;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-glass: rgba(250, 245, 235, 0.88);
    --border-gold: rgba(180, 130, 40, 0.35);
    --border-hover: rgba(180, 83, 9, 0.7);
    --gold-primary: #b45309;
    --gold-light: #78350f;
    --gold-shimmer: #92400e;
    --saffron: #c2410c;
    --saffron-light: #9a3412;
    --text-main: #26160c;
    --text-muted: #5c3d28;
    --text-verse: #1a0f08;
    --card-shadow: 0 10px 25px -5px rgba(120, 53, 15, 0.1);
    --glow: 0 0 20px rgba(180, 83, 9, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(234, 88, 12, 0.18) 0%, transparent 60%),
        radial-gradient(circle at 100% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 0% 80%, rgba(180, 83, 9, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-base);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Script typography */
.font-devanagari { font-family: 'Noto Serif Devanagari', 'Times New Roman', serif !important; }
.font-telugu { font-family: 'Noto Sans Telugu', var(--font-base) !important; }
.font-tamil { font-family: 'Noto Sans Tamil', var(--font-base) !important; }
.font-kannada { font-family: 'Noto Sans Kannada', var(--font-base) !important; }
.font-malayalam { font-family: 'Noto Sans Malayalam', var(--font-base) !important; }
.font-gujarati { font-family: 'Noto Sans Gujarati', var(--font-base) !important; }
.font-english { font-family: 'Times New Roman', Times, 'Georgia', serif !important; }
.font-english .verse-lines { font-family: 'Times New Roman', Times, 'Georgia', serif !important; }

/* HEADER */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(12, 6, 3, 0.88);
    border-bottom: 1px solid var(--border-gold);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

[data-theme="light"] .site-header {
    background: rgba(255, 252, 247, 0.94);
}

.header-container {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sacred-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle, #f59e0b 0%, #b45309 85%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
    border: 2px solid var(--gold-light);
    color: #fff;
    font-size: 1.55rem;
    font-weight: bold;
    flex-shrink: 0;
    transition: transform 0.4s ease;
}

.brand-section:hover .sacred-logo {
    transform: rotate(360deg);
}

.brand-text h1 {
    font-family: var(--font-sacred);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #fde68a 0%, #f59e0b 50%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.2;
}

.brand-text .subtext {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* SEARCH */
.search-wrapper {
    flex: 1;
    max-width: 380px;
    position: relative;
}

.search-input-box {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 30px;
    padding: 0.6rem 1.2rem 0.6rem 2.6rem;
    color: var(--text-main);
    font-size: 0.88rem;
    outline: none;
    transition: all 0.3s;
}

.search-input-box:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
    background: rgba(30, 15, 8, 0.95);
}

.search-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-primary);
    font-size: 0.95rem;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    display: none;
}

/* HEADER ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* LANGUAGE SELECTOR DROPDOWN */
.lang-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 24px;
    padding: 0.35rem 0.85rem;
    transition: all 0.3s ease;
}

.lang-selector-wrapper:hover, .lang-selector-wrapper:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.28);
}

.lang-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    cursor: pointer;
}

.lang-dropdown {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    padding: 0.2rem 0.2rem;
    max-width: 190px;
}

.lang-dropdown option {
    background: #190903;
    color: #fdfaf4;
    padding: 0.5rem;
    font-family: sans-serif;
}

[data-theme="light"] .lang-dropdown option {
    background: #ffffff;
    color: #1a0f08;
}

/* Fallback lang-pills if ever referenced */
.lang-pills { display: none; }
.lang-btn { display: none; }

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--gold-light);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--gold-primary);
    color: #000;
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.icon-btn.playing {
    background: var(--gold-primary);
    color: #000;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* LAYOUT */
.main-layout {
    max-width: 1500px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

/* SIDEBAR */
.sidebar-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6.5rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-primary) transparent;
}

.sidebar-title {
    font-family: var(--font-sacred);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--gold-primary);
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-gold);
}

/* HYMN PICKER */
.hymn-select-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
}

.hymn-nav-item {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.86rem;
    color: var(--text-muted);
    text-decoration: none;
}

.hymn-nav-item:hover {
    background: rgba(245, 158, 11, 0.12);
    color: var(--gold-light);
    border-color: var(--border-gold);
    transform: translateX(4px);
}

.hymn-nav-item.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 88, 12, 0.25));
    border-color: var(--gold-primary);
    color: #fff;
    font-weight: 600;
}

/* CATEGORIES ACCORDION */
.cat-group {
    margin-bottom: 0.5rem;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.cat-header {
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}

.cat-header:hover {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold-light);
}

.cat-content {
    display: none;
    padding: 0.5rem 0.8rem;
    background: rgba(0, 0, 0, 0.25);
    max-height: 220px;
    overflow-y: auto;
}

.cat-content.open {
    display: block;
}

.cat-item-link {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    transition: color 0.2s;
}

.cat-item-link:hover {
    color: var(--gold-primary);
    padding-left: 4px;
}

/* QUICK JUMP PILLS */
.quick-jump-container {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-gold);
}

.jump-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.jump-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.jump-btn:hover {
    background: var(--gold-primary);
    color: #000;
    font-weight: 600;
}

/* CONTENT PANEL */
.content-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 2.2rem;
    box-shadow: var(--card-shadow);
    position: relative;
}

/* HERO */
.hymn-hero {
    text-align: center;
    padding: 1.8rem 1.5rem 2.2rem;
    margin-bottom: 2rem;
    position: relative;
    border-bottom: 1px solid var(--border-gold);
    background: radial-gradient(ellipse at 50% 30%, rgba(245, 158, 11, 0.12) 0%, transparent 75%);
}

.deity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.9rem;
}

.hymn-main-title {
    font-family: var(--font-sacred);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.6rem;
    background: linear-gradient(135deg, #fff7ed 0%, #fde68a 40%, #f59e0b 80%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hymn-subtitle {
    font-size: 0.98rem;
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto 1.1rem;
}

.hymn-meta-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.meta-pill {
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

/* READING TOOLBAR */
.reading-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    background: rgba(15, 7, 3, 0.65);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.status-badge {
    font-size: 0.82rem;
    color: var(--gold-light);
    font-weight: 500;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-gold);
    color: var(--text-main);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tool-btn:hover {
    background: var(--gold-primary);
    color: #000;
}

.tool-btn.active {
    background: var(--gold-primary);
    color: #000;
    font-weight: bold;
}

/* SECTION CARDS */
.section-box {
    margin-bottom: 2.2rem;
    padding: 1.5rem 1.8rem;
    background: rgba(25, 12, 6, 0.65);
    border: 1px solid var(--border-gold);
    border-left: 4px solid var(--gold-primary);
    border-radius: 14px;
    position: relative;
}

[data-theme="light"] .section-box {
    background: rgba(255, 255, 255, 0.8);
}

.section-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.section-title {
    font-family: var(--font-sacred);
    font-size: 1.15rem;
    color: var(--gold-light);
    letter-spacing: 0.05em;
}

.section-text {
    font-size: var(--verse-scale);
    line-height: var(--verse-line-height);
    color: var(--text-verse);
    text-align: justify;
}

/* VERSE GRID */
.verse-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.verse-card {
    background: rgba(20, 10, 5, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 14px;
    padding: 1.3rem 1.6rem;
    transition: all 0.25s ease;
    position: relative;
}

[data-theme="light"] .verse-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(180, 130, 40, 0.2);
}

.verse-card:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.18);
    transform: translateY(-2px);
}

.verse-card.highlighted {
    border-color: #ef4444;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.verse-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.verse-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 0.5rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.2));
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-light);
    font-family: var(--font-sacred);
}

.verse-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.verse-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    font-size: 0.92rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.verse-action-btn:hover {
    color: var(--gold-primary);
}

.verse-action-btn.favorited {
    color: #f59e0b;
}

.verse-lines {
    font-size: var(--verse-scale);
    line-height: var(--verse-line-height);
    color: var(--text-verse);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.verse-lines p {
    margin-bottom: 0.25rem;
}

.verse-lines p:last-child {
    margin-bottom: 0;
}

.search-match {
    background: #f59e0b;
    color: #000;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0a0401;
    font-weight: 700;
    padding: 0.75rem 1.4rem;
    border-radius: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.9rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* BACK TO TOP */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 500;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--gold-primary);
    color: #000;
    transform: translateY(-3px);
}

/* FOOTER */
.site-footer {
    border-top: 1px solid var(--border-gold);
    background: rgba(10, 5, 2, 0.95);
    padding: 3rem 1.5rem 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-peace {
    font-family: var(--font-sacred);
    font-size: 1.5rem;
    color: var(--gold-primary);
    margin-bottom: 0.8rem;
    letter-spacing: 0.1em;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.footer-copy {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* MOBILE OVERLAY */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gold-light);
    font-size: 1.4rem;
    cursor: pointer;
}

/* PRINT STYLES */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .site-header, .sidebar-panel, .reading-toolbar, .site-footer, .back-to-top, .toast, .verse-actions {
        display: none !important;
    }
    .main-layout {
        display: block !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .content-panel {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: #fff !important;
    }
    .hymn-main-title {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        font-size: 1.8rem !important;
    }
    .verse-card {
        border: none !important;
        border-bottom: 1px solid #ddd !important;
        box-shadow: none !important;
        padding: 0.8rem 0 !important;
        page-break-inside: avoid;
    }
    .verse-lines {
        color: #000 !important;
        font-size: 1.1rem !important;
    }
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar-panel {
        position: static;
        max-height: none;
    }
    .search-wrapper {
        max-width: 260px;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    .sidebar-panel {
        display: none;
    }
    .sidebar-panel.mobile-open {
        display: block;
        position: fixed;
        top: 4.2rem;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2000;
        background: rgba(10, 5, 2, 0.98);
        border-radius: 0;
    }
    .header-actions .lang-pills {
        display: none;
    }
    .hymn-main-title {
        font-size: 1.6rem;
    }
}
