/* ============================================
   HadithWorld V2.0 - Premium Styles
   Modern, 3D, Glassmorphism Design
   ============================================ */

/* CSS Variables */
:root {
    /* ✨ STUNNING DARK THEME - Deep Space with Neon Accents ✨ */

    /* Primary Colors - Vibrant Purple */
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;

    /* Secondary Colors - Electric Cyan */
    --secondary: #06b6d4;
    --secondary-light: #22d3ee;
    --secondary-dark: #0891b2;

    /* Accent Colors - Hot Pink/Magenta */
    --accent: #ec4899;
    --accent-light: #f472b6;

    /* Background Colors - Deep Dark */
    --bg-dark: #0a0a0f;
    --bg-light: #12121a;
    --bg-cream: #16161f;
    --bg-lavender: #1a1a25;
    --bg-section: linear-gradient(180deg, #0a0a0f 0%, #12121a 25%, #16161f 50%, #1a1a25 75%, #0a0a0f 100%);
    --bg-card: rgba(139, 92, 246, 0.08);

    /* Text Colors - Light for dark backgrounds */
    --text-primary: #f8fafc;
    --text-secondary: rgba(248, 250, 252, 0.75);
    --text-muted: rgba(248, 250, 252, 0.5);

    /* Glass Effects - Dark glassmorphism */
    --glass-bg: rgba(20, 20, 30, 0.8);
    --glass-border: rgba(139, 92, 246, 0.3);

    /* ✨ STUNNING DARK GRADIENTS ✨ */

    /* Primary Gradient - Purple to Cyan Flow */
    --gradient-primary: linear-gradient(135deg, #c084fc 0%, #a855f7 20%, #8b5cf6 40%, #7c3aed 60%, #6366f1 80%, #06b6d4 100%);

    /* Soft Primary for Dark Backgrounds */
    --gradient-primary-soft: linear-gradient(135deg, #0a0a0f 0%, #1a1025 25%, #1e1030 50%, #15152a 75%, #0a0a0f 100%);

    /* Neon Accent Gradient */
    --gradient-gold: linear-gradient(135deg, #06b6d4 0%, #22d3ee 20%, #67e8f9 40%, #a5f3fc 50%, #22d3ee 70%, #06b6d4 100%);

    /* Dark Background Gradient */
    --gradient-light: linear-gradient(135deg, #12121a 0%, #16161f 25%, #1a1a25 50%, #1e1e2a 75%, #12121a 100%);

    /* Hero Section Gradient - Dark with subtle glow */
    --gradient-hero: linear-gradient(180deg, #0a0a0f 0%, #12121a 15%, #1a1025 30%, #1e1030 45%, #1a1025 60%, #12121a 80%, #0a0a0f 100%);

    /* Additional Stunning Gradients */
    --gradient-emerald: linear-gradient(135deg, #064e3b 0%, #065f46 25%, #047857 50%, #059669 75%, #10b981 100%);
    --gradient-sunset: linear-gradient(135deg, #7c2d12 0%, #9a3412 20%, #c2410c 40%, #ea580c 60%, #f97316 80%, #fb923c 100%);
    --gradient-ocean: linear-gradient(135deg, #164e63 0%, #155e75 20%, #0e7490 40%, #0891b2 60%, #06b6d4 80%, #22d3ee 100%);
    --gradient-aurora: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 20%, #a855f7 35%, #ec4899 50%, #f472b6 65%, #06b6d4 80%, #22d3ee 100%);

    /* Purple-Cyan Blend */
    --gradient-rose: linear-gradient(135deg, #581c87 0%, #6b21a8 20%, #7c3aed 40%, #8b5cf6 60%, #a855f7 80%, #c084fc 100%);

    /* Premium Neon Gradient */
    --gradient-warm: linear-gradient(135deg, #312e81 0%, #4338ca 25%, #6366f1 50%, #818cf8 75%, #a5b4fc 100%);

    /* Mystic Dark Blend */
    --gradient-mystic: linear-gradient(135deg, #0a0a0f 0%, #1a1025 15%, #2e1065 30%, #4c1d95 50%, #6d28d9 70%, #8b5cf6 85%, #a855f7 100%);

    /* ✨ BEAUTIFUL GLOWING SHADOWS ✨ */
    --shadow-sm: 0 2px 10px rgba(139, 92, 246, 0.15);
    --shadow-md: 0 4px 25px rgba(139, 92, 246, 0.2);
    --shadow-lg: 0 15px 50px rgba(139, 92, 246, 0.25);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.5), 0 0 80px rgba(6, 182, 212, 0.3);
    --shadow-gold: 0 0 40px rgba(6, 182, 212, 0.4), 0 0 80px rgba(34, 211, 238, 0.2);
    --shadow-soft: 0 10px 40px rgba(139, 92, 246, 0.2);
    --shadow-rose: 0 0 40px rgba(236, 72, 153, 0.3), 0 0 80px rgba(244, 114, 182, 0.15);
    --shadow-warm: 0 0 40px rgba(99, 102, 241, 0.4), 0 0 80px rgba(139, 92, 246, 0.2);

    /* Typography */
    --font-primary: 'Outfit', sans-serif;
    --font-arabic: 'Amiri', serif;

    /* Transitions - OPTIMIZED for performance */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* Native scrolling - no smooth scroll for better performance */
    scroll-padding-top: 100px;
}

/* Prefer reduced motion for accessibility and performance */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: var(--font-primary);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: linear-gradient(180deg, #0a0a0f 0%, #12121a 30%, #16161f 60%, #0a0a0f 100%);
}

/* Animated Background - Dark Theme with Neon Glows */
/* PERFORMANCE: Static background - no animations */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(ellipse at 15% 25%, rgba(139, 92, 246, 0.2) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 60%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 75%, rgba(6, 182, 212, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 35%),
        linear-gradient(180deg, #0a0a0f 0%, #12121a 20%, #1a1025 40%, #16161f 60%, #12121a 80%, #0a0a0f 100%);
    /* Static for performance */
    will-change: auto;
    contain: strict;
}

@keyframes bgShift {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
        filter: hue-rotate(0deg);
    }

    33% {
        transform: scale(1.05) rotate(1deg);
        filter: hue-rotate(5deg);
    }

    66% {
        transform: scale(1.08) rotate(-1deg);
        filter: hue-rotate(-3deg);
    }
}

/* Floating Particles */
/* PERFORMANCE: Reduced complexity, use GPU-accelerated properties */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0.5;
    /* PERFORMANCE: Use transform for GPU acceleration */
    will-change: transform, opacity;
    animation: float 20s infinite linear;
    backface-visibility: hidden;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Glass Card Effect - Dark Theme */
/* PERFORMANCE: Optimized for dark glassmorphism */
.glass-card {
    background: rgba(20, 20, 30, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    will-change: auto;
    transform: translateZ(0);
}

/* ============================================
   Header / Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 2rem;
    transition: var(--transition-normal);
}

.header.scrolled {
    background: rgba(15, 15, 22, 0.95);
    /* PERFORMANCE: Reduced blur for smoother scrolling */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
    padding: 0.75rem 2rem;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 2rem;
    color: var(--secondary);
    text-shadow: var(--shadow-gold);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-version {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav-link i {
    color: var(--primary);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-dark);
    background: rgba(109, 40, 217, 0.08);
}

.nav-link i.fa-chevron-down {
    font-size: 0.7rem;
    transition: var(--transition-fast);
}

.nav-item:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Menu */
/* PERFORMANCE: Reduced blur for smoother performance */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) translateZ(0);
    transition: var(--transition-normal);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.1);
    will-change: opacity, visibility, transform;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.dropdown-menu li a:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.dropdown-menu li a .arabic {
    font-family: var(--font-arabic);
    font-size: 0.85rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-btn,
.theme-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover,
.theme-btn:hover {
    background: var(--primary);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-normal);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1400px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.badge i {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-title .line-1 {
    display: block;
    color: var(--text-primary);
}

.hero-title .line-2 {
    display: block;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* Search Container */
.search-container {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.search-tab.active {
    background: var(--primary);
    color: var(--text-primary);
}

.search-simple,
.search-advanced {
    display: none;
}

.search-simple.active,
.search-advanced.active {
    display: block;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(30, 30, 45, 0.8);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(139, 92, 246, 0.25);
    transition: var(--transition-fast);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.search-input-wrapper>i:first-child {
    color: var(--text-muted);
    margin-right: 0.75rem;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.75rem 0;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-submit {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-submit:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.search-submit i {
    margin: 0;
    line-height: 1;
}

/* Advanced Search */
.search-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.search-field input,
.search-field select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(30, 30, 45, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.search-field input:focus,
.search-field select:focus {
    border-color: var(--primary-light);
}

.search-field select {
    cursor: pointer;
}

.search-advanced-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.search-advanced-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--glass-border);
}

/* Hero Visual - 3D Book */
.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.book-3d {
    position: relative;
    transform-style: preserve-3d;
    animation: bookFloat 6s ease-in-out infinite;
}

@keyframes bookFloat {

    0%,
    100% {
        transform: translateY(0) rotateY(-15deg) rotateX(5deg);
    }

    50% {
        transform: translateY(-20px) rotateY(-10deg) rotateX(10deg);
    }
}

.book-cover {
    position: relative;
    width: 280px;
    height: 380px;
    transform-style: preserve-3d;
}

.book-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transform: translateZ(20px);
    border: 3px solid var(--secondary);
}

.book-front::before {
    content: '';
    position: absolute;
    inset: 15px;
    border: 2px solid rgba(6, 182, 212, 0.5);
    border-radius: var(--radius-sm);
}

.arabic-large {
    font-family: var(--font-arabic);
    font-size: 4rem;
    color: var(--secondary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.book-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.book-spine {
    position: absolute;
    left: -20px;
    width: 40px;
    height: 100%;
    background: var(--primary-dark);
    transform: rotateY(-90deg) translateZ(0);
    transform-origin: right;
    border-radius: 4px 0 0 4px;
}

.book-pages {
    position: absolute;
    right: -10px;
    width: 20px;
    height: calc(100% - 10px);
    top: 5px;
    background: repeating-linear-gradient(to right,
            #f5f5f0,
            #f5f5f0 1px,
            #e0e0d8 1px,
            #e0e0d8 2px);
    transform: translateZ(19px);
    border-radius: 0 2px 2px 0;
}

.book-glow {
    position: absolute;
    width: 300px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(167, 139, 250, 0.35) 0%, transparent 70%);
    filter: blur(40px);
    z-index: -1;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(30, 30, 45, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 15px rgba(139, 92, 246, 0.15);
}

.float-card i {
    color: var(--secondary);
}

.float-1 {
    top: 10%;
    right: 0;
    animation: floatCard1 8s ease-in-out infinite;
}

.float-2 {
    top: 35%;
    left: 5%;
    animation: floatCard2 10s ease-in-out infinite;
}

.float-3 {
    bottom: 10%;
    right: 10%;
    animation: floatCard3 9s ease-in-out infinite;
}

@keyframes floatCard1 {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-15px) translateX(-10px);
    }
}

@keyframes floatCard2 {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(10px) translateX(15px);
    }
}

@keyframes floatCard3 {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-10px) translateX(-15px);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    animation: fadeInUp 1s ease 1s both;
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: var(--secondary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Animate Float */
.animate-float {
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ============================================
   Beautiful Scroll Reveal Animations
   ============================================ */

/* Base animation state for sections */
.section-animate {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.section-animate.section-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero section should be visible immediately */
.hero.section-animate {
    opacity: 1;
    transform: none;
}

/* Base scroll animate class */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: opacity, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.scroll-animate.is-visible {
    opacity: 1;
    transform: none !important;
}

/* Fade Up Animation */
.animate-fade-up {
    transform: translateY(50px);
}

.animate-fade-up.is-visible {
    transform: translateY(0);
}

/* Fade Down Animation */
.animate-fade-down {
    transform: translateY(-40px);
}

.animate-fade-down.is-visible {
    transform: translateY(0);
}

/* Fade Left Animation */
.animate-fade-left {
    transform: translateX(60px);
}

.animate-fade-left.is-visible {
    transform: translateX(0);
}

/* Fade Right Animation */
.animate-fade-right {
    transform: translateX(-60px);
}

.animate-fade-right.is-visible {
    transform: translateX(0);
}

/* Scale Up Animation */
.animate-scale-up {
    transform: scale(0.85);
}

.animate-scale-up.is-visible {
    transform: scale(1);
}

/* Slide Up Animation (with bounce) */
.animate-slide-up {
    transform: translateY(80px) rotateX(-10deg);
}

.animate-slide-up.is-visible {
    transform: translateY(0) rotateX(0);
}

/* Rotate In Animation */
.animate-rotate-in {
    transform: rotate(-10deg) scale(0.9);
}

.animate-rotate-in.is-visible {
    transform: rotate(0) scale(1);
}

/* Flip Animation */
.animate-flip {
    transform: perspective(600px) rotateY(-30deg);
}

.animate-flip.is-visible {
    transform: perspective(600px) rotateY(0);
}

/* Zoom In Animation */
.animate-zoom-in {
    transform: scale(0.6);
}

.animate-zoom-in.is-visible {
    transform: scale(1);
}

/* Animation Delays */
.animate-delay-1 {
    transition-delay: 0.1s !important;
}

.animate-delay-2 {
    transition-delay: 0.2s !important;
}

.animate-delay-3 {
    transition-delay: 0.3s !important;
}

.animate-delay-4 {
    transition-delay: 0.4s !important;
}

.animate-delay-5 {
    transition-delay: 0.5s !important;
}

/* Staggered children animation support */
.scroll-animate[style*="--stagger-delay"] {
    transition-delay: var(--stagger-delay, 0s);
}

/* Special glow effect on reveal */
.scroll-animate.is-visible::after {
    animation: revealGlow 1s ease-out forwards;
}

@keyframes revealGlow {
    0% {
        box-shadow: 0 0 30px rgba(167, 139, 250, 0.3);
    }

    100% {
        box-shadow: none;
    }
}

/* Smooth content reveal for text elements */
.section-header.scroll-animate {
    position: relative;
}

.section-header.scroll-animate::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--bg-dark), transparent);
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
    pointer-events: none;
}

.section-header.scroll-animate.is-visible::before {
    transform: translateX(100%);
    opacity: 0.3;
}

/* Parallax-like scroll effect for background elements */
.section-animate .library-bg,
.section-animate .narrators-bg-effects,
.section-animate .hadith-day-bg {
    transform: scale(1.1);
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.section-animate.section-visible .library-bg,
.section-animate.section-visible .narrators-bg-effects,
.section-animate.section-visible .hadith-day-bg {
    transform: scale(1);
}

/* Enhanced card hover after scroll reveal */
.scroll-animate.is-visible.library-book,
.scroll-animate.is-visible.narrator-card-3d,
.scroll-animate.is-visible.future-feature-card {
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        filter 0.7s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s ease;
}

/* Floating animation after reveal */
@keyframes floatAfterReveal {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.scroll-animate.is-visible.hadith-day-card {
    animation: floatAfterReveal 6s ease-in-out infinite;
    animation-delay: 0.7s;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    .section-animate,
    .scroll-animate {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .scroll-animate.is-visible {
        animation: none;
    }
}