/* ========================================
   Bhagavad Gītā Application CSS
   Dark/Light Mode Support
   ======================================== */

/* Light Mode Variables (Default) */
:root {
    /* Colors */
    --primary-color: #1e5f8c;
    --secondary-color: #4ecdc4;
    --accent-color: #059669;
    --peacock-purple: #7c3aed;
    --peacock-gold: #fbbf24;
    
    /* Backgrounds */
    --background-color: #f0f9ff;
    --card-background: #ffffff;
    --surface-color: #ffffff;
    --overlay-color: rgba(0, 0, 0, 0.5);
    
    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #0f766e;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    /* Borders & Shadows */
    --border-color: #bae6fd;
    --border-light: #e0f2fe;
    --shadow-light: 0 2px 12px rgba(30, 95, 140, 0.1);
    --shadow-medium: 0 4px 20px rgba(30, 95, 140, 0.15);
    --shadow-heavy: 0 8px 32px rgba(30, 95, 140, 0.2);
    
    /* Component Specific */
    --header-bg: #ffffff;
    --header-border: #e0f2fe;
    --card-hover-bg: #e0f2fe;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    
    /* Theme Toggle */
    --toggle-bg: #cbd5e1;
    --toggle-knob: #ffffff;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    /* Colors - Adjusted for dark mode */
    --primary-color: #60a5fa;
    --secondary-color: #34d399;
    --accent-color: #10b981;
    --peacock-purple: #a78bfa;
    --peacock-gold: #fcd34d;
    
    /* Backgrounds */
    --background-color: #0f172a;
    --card-background: #1e293b;
    --surface-color: #334155;
    --overlay-color: rgba(0, 0, 0, 0.7);
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #34d399;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    /* Borders & Shadows */
    --border-color: #334155;
    --border-light: #475569;
    --shadow-light: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* Component Specific */
    --header-bg: #1e293b;
    --header-border: #334155;
    --card-hover-bg: #334155;
    --input-bg: #334155;
    --input-border: #475569;
    
    /* Theme Toggle */
    --toggle-bg: #475569;
    --toggle-knob: #60a5fa;
}

/* Smooth Transitions for Theme Switch */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

body {
    margin: 0;
    font-family: 'Noto Serif', serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background-color);
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--toggle-bg);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.theme-toggle:hover {
    background: var(--border-light);
}

.theme-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: var(--toggle-knob);
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(30px);
}

.theme-toggle-icon {
    font-size: 0.75rem;
    color: var(--text-inverse);
}

/* Page Header Section */
.page-header-section {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Section Divider */
.section-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.divider-ornament {
    display: inline-block;
    font-size: 1.5rem;
    color: var(--secondary-color);
    opacity: 0.6;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 3rem 0;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    font-family: 'Noto Serif', serif;
}

.cta-button:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Chapter Cards Grid */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.chapter-card {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--peacock-purple));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.chapter-card:hover::before {
    transform: scaleX(1);
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--secondary-color);
    background: var(--card-hover-bg);
}

.chapter-number {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.chapter-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.chapter-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.chapter-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.chapter-meta i {
    margin-right: 0.25rem;
    color: var(--primary-color);
}

/* Verse List */
.verse-list {
    margin-top: 2rem;
}

.verse-list-item {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.verse-list-item::after {
    content: '🦚';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.verse-list-item:hover {
    border-color: var(--secondary-color);
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
    background: var(--card-hover-bg);
}

.verse-list-item:hover::after {
    opacity: 0.3;
    transform: translateY(-50%) scale(1.1);
}

.verse-list-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.verse-list-number {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.verse-list-number i {
    margin-right: 0.5rem;
}

.verse-list-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Verse Display Container */
.verse-container {
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-light);
}

.verse-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.verse-number {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.verse-number i {
    margin-right: 0.5rem;
    color: var(--secondary-color);
}

.verse-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    background: var(--surface-color);
}

.verse-section:nth-child(even) {
    background: var(--card-hover-bg);
    border: 1px solid var(--border-color);
}

.verse-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
}

.verse-label i {
    margin-right: 0.5rem;
}

.sanskrit {
    font-size: 1.6rem;
    line-height: 2;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0;
}

.transliteration {
    font-style: italic;
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0;
}

.translation {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* Verse Navigation */
.verse-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.verse-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Noto Serif', serif;
    flex: 1;
    justify-content: center;
    min-width: 150px;
}

.verse-nav-btn:hover:not(:disabled) {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.verse-nav-btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    border-color: var(--border-color);
}

.verse-nav-btn i {
    font-size: 0.9rem;
}

/* Introduction Page */
.intro-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.intro-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.intro-section h2 i {
    margin-right: 0.75rem;
    color: var(--secondary-color);
}

.intro-section p {
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.intro-section ul {
    list-style: none;
    padding: 0;
}

.intro-section ul li {
    padding: 0.5rem 0;
    color: var(--text-primary);
}

/* FAQ Styles */
.faqs-search-section {
    background: var(--card-background);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    border: 2px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.category-tag {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-tag:hover,
.category-tag.active {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}

.faqs-list {
    background: var(--card-background);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    border: 2px solid var(--border-color);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    background: var(--card-background);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: var(--card-hover-bg);
}

.faq-icon {
    width: 40px;
    height: 40px;
    background: var(--surface-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.related-verses {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface-color);
    border-left: 4px solid var(--accent-color);
    border-radius: 0.5rem;
}

.verse-link {
    padding: 0.25rem 0.75rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.verse-link:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .container { padding: 0.75rem; }
    .hero-title { font-size: 2rem; }
    .page-title { font-size: 1.8rem; }
    .chapters-grid { grid-template-columns: 1fr; gap: 1rem; }
    .verse-container { padding: 1.25rem; }
    .sanskrit { font-size: 1.3rem; }
    .mindmap-wrapper { padding: 1.5rem; }
    .mindmap-branches { grid-template-columns: 1fr; }
}

/* Print Styles */
@media print {
    [data-theme="dark"] {
        --background-color: #ffffff;
        --card-background: #ffffff;
        --text-primary: #000000;
        --border-color: #000000;
    }
    
    .theme-toggle,
    .verse-navigation,
    .mindmap-actions,
    .faqs-actions {
        display: none !important;
    }
}