/* ═══════════════════════════════════════════════════════════════════════════
   TAMIL BIBLE - ULTRA-MODERN GLASSMORPHISM DESIGN SYSTEM
   Version: 2.0.0 | 2026
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   1. DESIGN TOKENS & CSS VARIABLES
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    /* Typography */
    --reader-font-size: 1.25rem;
    --reader-line-height: 2.2;

    /* Primary Color System */
    --primary-hue: 221;
    --primary-color: hsl(var(--primary-hue), 83%, 53%);
    --primary-color-dim: hsl(var(--primary-hue), 83%, 96%);
    --primary-color-glow: hsla(var(--primary-hue), 90%, 60%, 0.4);

    /* Light Mode Base */
    --bg-base: #f0f4f8;
    --bg-paper: #fafbfc;
    --text-ink: #1a202c;
    --text-muted: #64748b;
    --highlight-gold: #fef08a;

    /* Glassmorphism - Light */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-border-subtle: rgba(255, 255, 255, 0.2);
    --glass-blur: 20px;
    --glass-blur-heavy: 40px;

    /* Shadows & Glows */
    --shadow-soft: 0 4px 24px -4px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 32px -8px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 20px 60px -15px rgba(0, 0, 0, 0.2);
    --glow-primary: 0 0 30px var(--primary-color-glow);
    --glow-subtle: 0 0 60px rgba(139, 92, 246, 0.15);

    /* Aurora Gradient Colors */
    --aurora-1: hsl(280, 70%, 60%);
    --aurora-2: hsl(210, 90%, 60%);
    --aurora-3: hsl(340, 80%, 60%);
    --aurora-4: hsl(170, 70%, 50%);

    /* Animation Timing */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.4s;
    --duration-slow: 0.6s;
}

/* Dark Mode Tokens */
.dark {
    --bg-base: #0a0c14;
    --bg-paper: #0f1219;
    --text-ink: #e2e8f0;
    --text-muted: #94a3b8;

    /* Glassmorphism - Dark */
    --glass-bg: rgba(15, 20, 35, 0.75);
    --glass-bg-hover: rgba(25, 32, 50, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-subtle: rgba(255, 255, 255, 0.04);

    /* Dark Shadows */
    --shadow-soft: 0 4px 24px -4px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 8px 32px -8px rgba(0, 0, 0, 0.5);
    --shadow-heavy: 0 20px 60px -15px rgba(0, 0, 0, 0.7);
    --glow-subtle: 0 0 80px rgba(139, 92, 246, 0.2);

    --primary-color-dim: hsl(var(--primary-hue), 70%, 15%);
}


/* ─────────────────────────────────────────────────────────────────────────────
   2. ANIMATED AURORA BACKGROUND
   ───────────────────────────────────────────────────────────────────────────── */

body {
    background-color: var(--bg-base);
    color: var(--text-ink);
    position: relative;
    overflow-x: hidden;
}

/* Aurora Gradient Layer */
body::before {
    content: '';
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, var(--aurora-1), transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 30%, var(--aurora-2), transparent 45%),
        radial-gradient(ellipse 70% 50% at 50% 90%, var(--aurora-3), transparent 50%),
        radial-gradient(ellipse 50% 30% at 90% 70%, var(--aurora-4), transparent 40%);
    opacity: 0.12;
    animation: auroraShift 25s ease-in-out infinite alternate;
    z-index: -2;
    pointer-events: none;
}

.dark body::before,
body.dark::before {
    opacity: 0.18;
}

/* Noise Texture Overlay for Depth */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    z-index: -1;
    pointer-events: none;
}

@keyframes auroraShift {
    0% {
        transform: translate(0%, 0%) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(5%, -3%) rotate(2deg) scale(1.02);
    }

    66% {
        transform: translate(-3%, 5%) rotate(-1deg) scale(0.98);
    }

    100% {
        transform: translate(2%, 2%) rotate(1deg) scale(1.01);
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   3. GLASSMORPHISM COMPONENTS
   ───────────────────────────────────────────────────────────────────────────── */

/* Base Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-medium);
    transition: all var(--duration-normal) var(--ease-smooth);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--shadow-heavy), var(--glow-subtle);
    transform: translateY(-2px);
}

/* Glass Card - Subtle Variant */
.glass-subtle {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border-subtle);
    border-radius: 16px;
}

/* Glass Header */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border: 1px solid var(--glass-border);
    border-top: none;
    box-shadow:
        var(--shadow-medium),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Glass Button */
.glass-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    transition: all var(--duration-fast) var(--ease-spring);
}

.glass-btn:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--glow-primary);
    transform: scale(1.02);
}

.glass-btn:active {
    transform: scale(0.98);
}

/* Glass Input */
.glass-input {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border-subtle);
    border-radius: 12px;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-glow);
    outline: none;
}


/* ─────────────────────────────────────────────────────────────────────────────
   4. HERO SECTION - GRADIENT MESH
   ───────────────────────────────────────────────────────────────────────────── */

.glass-hero {
    background:
        linear-gradient(135deg,
            hsla(var(--primary-hue), 80%, 50%, 0.9) 0%,
            hsla(var(--primary-hue), 90%, 35%, 0.95) 50%,
            hsla(calc(var(--primary-hue) + 30), 70%, 40%, 0.9) 100%);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    position: relative;
    overflow: hidden;
}

.glass-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 30%);
    animation: heroOrbs 15s ease-in-out infinite alternate;
}

.glass-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: heroGlow 10s ease-in-out infinite;
}

@keyframes heroOrbs {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(5%, 5%) scale(1.1);
    }
}

@keyframes heroGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(0, 0);
    }

    50% {
        opacity: 0.8;
        transform: translate(-10%, 10%);
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   5. TYPOGRAPHY
   ───────────────────────────────────────────────────────────────────────────── */

.font-tamil {
    font-family: 'Tiro Tamil', serif;
    letter-spacing: 0.01em;
}

.text-reader {
    line-height: var(--reader-line-height) !important;
    font-size: var(--reader-font-size) !important;
}


/* ─────────────────────────────────────────────────────────────────────────────
   6. VERSE STYLING - GLASSMORPHISM ENHANCED
   ───────────────────────────────────────────────────────────────────────────── */

.verse-item {
    position: relative;
    padding: 0.75rem 1rem 0.75rem 2rem;
    border-radius: 16px;
    transition: all var(--duration-normal) var(--ease-spring);
    opacity: 0;
    animation: verseSlideIn 0.5s var(--ease-spring) forwards;
}

.verse-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border: 1px solid transparent;
    transition: all var(--duration-normal) var(--ease-smooth);
    z-index: -1;
}

.verse-item:hover {
    transform: translateX(8px);
}

.verse-item:hover::before {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--glass-border);
    box-shadow: var(--shadow-soft), var(--glow-subtle);
}

/* Active Verse */
.verse-item.active-verse {
    transform: translateX(8px) scale(1.01);
}

.verse-item.active-verse::before {
    background: var(--glass-bg-hover);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium), var(--glow-primary);
}

/* Verse Number */
.verse-num {
    opacity: 0.35;
    transition: all var(--duration-fast) var(--ease-smooth);
    font-weight: 700;
}

.verse-item:hover .verse-num {
    opacity: 1;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-color-glow);
}

/* Staggered Animation Delays */
@keyframes verseSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

.verse-item:nth-child(1) {
    animation-delay: 0.05s;
}

.verse-item:nth-child(2) {
    animation-delay: 0.08s;
}

.verse-item:nth-child(3) {
    animation-delay: 0.11s;
}

.verse-item:nth-child(4) {
    animation-delay: 0.14s;
}

.verse-item:nth-child(5) {
    animation-delay: 0.17s;
}

.verse-item:nth-child(6) {
    animation-delay: 0.20s;
}

.verse-item:nth-child(7) {
    animation-delay: 0.23s;
}

.verse-item:nth-child(8) {
    animation-delay: 0.26s;
}

/* Selected Verse - Uses Accent Color */
.verse-item.selected-verse {
    position: relative;
}

.verse-item.selected-verse::before {
    background: var(--primary-color-dim);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-soft), var(--glow-primary);
}

.verse-item.selected-verse::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--primary-color-glow);
}

/* Selected Verse Number */
.selected-verse-num {
    opacity: 1 !important;
    color: var(--primary-color) !important;
    text-shadow: 0 0 15px var(--primary-color-glow);
}


/* ─────────────────────────────────────────────────────────────────────────────
   7. SCROLLBAR - SLEEK GLASS STYLE
   ───────────────────────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
            rgba(156, 163, 175, 0.4) 0%,
            rgba(156, 163, 175, 0.2) 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
            rgba(var(--primary-hue), 83%, 53%, 0.6) 0%,
            rgba(var(--primary-hue), 83%, 53%, 0.3) 100%);
    background-clip: padding-box;
}

.dark ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}


/* ─────────────────────────────────────────────────────────────────────────────
   8. ANIMATIONS & TRANSITIONS
   ───────────────────────────────────────────────────────────────────────────── */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--primary-color-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--primary-color-glow), 0 0 60px var(--primary-color-glow);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s var(--ease-spring) forwards;
}

.animate-fade-in-scale {
    animation: fadeInScale 0.4s var(--ease-spring) forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}


/* ─────────────────────────────────────────────────────────────────────────────
   9. MODAL ENHANCEMENTS
   ───────────────────────────────────────────────────────────────────────────── */

.glass-modal-backdrop {
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.4) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.glass-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border: 1px solid var(--glass-border);
    box-shadow:
        var(--shadow-heavy),
        0 0 100px -20px var(--primary-color-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}


/* ─────────────────────────────────────────────────────────────────────────────
   10. FLOATING ACTION BAR - PREMIUM GLASS
   ───────────────────────────────────────────────────────────────────────────── */

.glass-action-bar {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border: 1px solid var(--glass-border);
    box-shadow:
        var(--shadow-heavy),
        var(--glow-subtle),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}


/* ─────────────────────────────────────────────────────────────────────────────
   11. ACCENT COLOR BUTTONS - GLOW EFFECT
   ───────────────────────────────────────────────────────────────────────────── */

.accent-btn {
    position: relative;
    transition: all var(--duration-fast) var(--ease-spring);
}

.accent-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: inherit;
    filter: blur(10px);
    opacity: 0;
    transition: opacity var(--duration-fast);
    z-index: -1;
}

.accent-btn:hover::after {
    opacity: 0.6;
}

.accent-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px currentColor;
}


/* ─────────────────────────────────────────────────────────────────────────────
   12. DASHBOARD CARDS - GLASS WIDGETS
   ───────────────────────────────────────────────────────────────────────────── */

.widget-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    transition: all var(--duration-normal) var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.widget-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-heavy), var(--glow-subtle);
    border-color: rgba(255, 255, 255, 0.3);
}

.dark .widget-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}


/* ─────────────────────────────────────────────────────────────────────────────
   13. FEATURE ICONS - GLOW ON HOVER
   ───────────────────────────────────────────────────────────────────────────── */

.feature-icon {
    position: relative;
    transition: all var(--duration-normal) var(--ease-spring);
}

.feature-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    filter: blur(16px);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--duration-normal);
}

.widget-card:hover .feature-icon::after {
    opacity: 0.5;
}

.widget-card:hover .feature-icon {
    transform: scale(1.1);
}


/* ─────────────────────────────────────────────────────────────────────────────
   14. RESPONSIVE ADJUSTMENTS
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    :root {
        --glass-blur: 16px;
        --glass-blur-heavy: 24px;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .glass-card {
        border-radius: 20px;
    }

    .widget-card {
        border-radius: 24px;
    }

    .verse-item {
        padding: 0.5rem 0.75rem 0.5rem 1.5rem;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   15. SELECTION HIGHLIGHT
   ───────────────────────────────────────────────────────────────────────────── */

::selection {
    background: hsla(var(--primary-hue), 80%, 60%, 0.3);
    color: inherit;
}

.dark ::selection {
    background: hsla(var(--primary-hue), 80%, 50%, 0.4);
}