:root {
    /* Premium Color Palette (HSL) */
    --p-h: 160;
    --p-s: 84%;
    --p-l: 39%;
    --primary: hsl(var(--p-h), var(--p-s), var(--p-l));
    --primary-light: hsl(var(--p-h), var(--p-s), 95%);
    --primary-dark: hsl(var(--p-h), var(--p-s), 30%);
    
    /* Light Mode Tokens */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] {
    --bg-main: #020617;
    --bg-card: #0f172a;
    --bg-header: rgba(15, 23, 42, 0.8);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.5);
    --glass: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-light: rgba(16, 185, 129, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

.arabic {
    font-family: 'Amiri', serif;
    font-size: 2rem;
    line-height: 2.5;
    text-align: right;
    color: var(--primary);
}

/* Glassmorphism */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.4rem;
    font-weight: 800;
}

.logo i {
    font-size: 1.6rem;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Theme Toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--primary);
    color: white;
}

.back-btn-header {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-btn-header:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-3px);
}


/* Premium Hero Section (Enlarged) */
.hero-premium.compact-top {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-radius: 40px;
    padding: 3rem 2rem;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0 3rem;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    box-shadow: 0 30px 60px rgba(16, 185, 129, 0.25);
}

.hero-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    transform: rotate(-45deg);
}

.hero-content-inner {
    position: relative;
    z-index: 2;
}

.badge-new {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 800;
    display: inline-block;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.hero-premium h1 {
    font-size: clamp(3rem, 7vw, 4.5rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
    font-weight: 900;
}

.hero-premium h1 span {
    color: #ffd700;
}

.hero-premium p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.quick-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    backdrop-filter: blur(5px);
}

.hero-image-small {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
    margin-bottom: 0.5rem;
    border: 4px solid rgba(255,255,255,0.2);
}

.banner-img-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Category Sections */
.category-section {
    margin-bottom: 5rem;
}

.section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-main);
    font-weight: 800;
}

.section-title i {
    color: var(--primary);
}

/* Updated Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-card);
    border-radius: 28px;
    padding: 2rem;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    background: var(--primary-light);
}

.card-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
    font-weight: 800;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Search Removed */

/* Global Search Input Pro */
.search-input-pro {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.search-input-pro input {
    width: 100%;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-pro i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.search-input-pro input:focus {
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
    transform: translateY(-2px);
    background: var(--bg-main);
}

.search-input-pro input:focus + i {
    transform: translateY(-50%) scale(1.2);
}

/* Prayer Grid Improvements */
.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.prayer-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.prayer-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.3);
}

.prayer-icon-box {
    width: 54px;
    height: 54px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.prayer-item.active .prayer-icon-box {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.prayer-info {
    flex: 1;
}

.prayer-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.prayer-item.active .prayer-name {
    color: rgba(255, 255, 255, 0.8);
}

.prayer-time {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.prayer-item.active .prayer-time {
    color: white;
}

.active-dot {
    width: 8px;
    height: 8px;
    background: #ffd700;
    border-radius: 50%;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    box-shadow: 0 0 10px #ffd700;
}
.surah-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.surah-item {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.surah-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.surah-num {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transform: rotate(45deg);
}

.surah-num span {
    transform: rotate(-45deg);
}

.surah-info {
    flex: 1;
}

.surah-name-ar {
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    color: var(--primary);
}

/* Prayer Times UI */
.prayer-hero {
    background: var(--primary);
    color: white;
    padding: 3rem 2rem;
    border-radius: 32px;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.prayer-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.prayer-item.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.prayer-time {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: var(--primary);
}

/* Chat AI */
.chat-container {
    height: 60vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 24px;
    border: 1px solid var(--border);
}

.chat-bubble {
    max-width: 80%;
    padding: 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* Tasbih */
.tasbih-display {
    width: 280px;
    height: 280px;
    margin: 4rem auto;
    background: var(--bg-card);
    border: 8px solid var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.1s;
    user-select: none;
}

.tasbih-display:active {
    transform: scale(0.95);
}

.tasbih-count {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

/* MASTERPIECE SPLASH ANIMATIONS */
@keyframes raysSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

@keyframes sStar {
    0% { left: -20%; top: 10%; opacity: 0; }
    5% { opacity: 1; }
    15% { left: 120%; top: 40%; opacity: 0; }
    100% { left: 120%; top: 40%; opacity: 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes sway {
    0%, 100% { transform: rotate(-5deg); transform-origin: top center; }
    50% { transform: rotate(5deg); transform-origin: top center; }
}

@keyframes auraPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.4; }
}

@keyframes floatCenter {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-30px); }
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.5); }
}

@keyframes revealUp {
    from { opacity: 0; transform: translateY(50px); filter: blur(15px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.credit {
    font-weight: 700;
    color: var(--primary);
    margin-top: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem 6rem 1rem;
    }
    
    .hero h1 {
        font-size: 2.2rem !important;
        margin-top: 1rem;
    }

    .nav-menu-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-header);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        justify-content: space-around;
        padding: 0.8rem 0.5rem;
        border-top: 1px solid var(--border);
        z-index: 1000;
        box-shadow: 0 -10px 20px rgba(0,0,0,0.05);
    }

    .nav-item-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        gap: 4px;
        flex: 1;
        transition: all 0.3s ease;
    }

    .nav-item-mobile i {
        font-size: 1.2rem;
    }

    .nav-item-mobile span {
        font-size: 0.7rem;
        font-weight: 600;
    }

    .nav-item-mobile.active {
        color: var(--primary);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .card {
        padding: 1.5rem;
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
    }

    .card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .card h3 {
        font-size: 1.1rem;
        margin-bottom: 0;
    }

    .card p {
        display: none; /* Hide description on mobile for compact list */
    }

    header {
        padding: 0.5rem 0;
    }

    .logo span {
        font-size: 1.2rem;
    }
}

/* Desktop Bottom Nav Hide */
@media (min-width: 769px) {
    .nav-menu-mobile {
        display: none;
    }
}


/* RESPONSIVE SPLASH SCREENS SYSTEM */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: radial-gradient(circle at center, #064e3b 0%, #020617 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-only { display: flex; }
.desktop-only { display: none; }

@media (min-width: 1024px) {
    .mobile-only { display: none !important; }
    .desktop-only { display: flex !important; }
}

.lantern-gallery, .lantern-gallery-desktop {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.lantern { 
    position: absolute; 
    text-align: center; 
    animation: sway 4s infinite ease-in-out; 
}

.lantern i { 
    color: #d4af37; 
    font-size: 2rem; 
    text-shadow: 0 0 20px #d4af37; 
}

.string { 
    width: 1px; 
    background: #d4af37; 
    margin: 0 auto; 
}

.crescent-center, .crescent-center-desktop {
    font-size: 7rem;
    color: #d4af37;
    position: relative;
    filter: drop-shadow(0 0 40px rgba(212, 175, 55, 0.6));
    animation: floatCenter 4s infinite ease-in-out;
}

@media (min-width: 1024px) {
    .crescent-center-desktop { font-size: 10rem; }
}

.mini-star, .mini-star-large {
    position: absolute;
    top: 10px;
    right: -10px;
    font-size: 2rem;
    animation: starTwinkle 2s infinite;
}

.typography, .typography-desktop { text-align: center; margin-top: 30px; z-index: 10; }
.bismillah, .bismillah-large { font-family: "Amiri", serif; color: #d4af37; font-size: 2.5rem; animation: revealUp 1s forwards 0.5s; opacity: 0; }
.brand, .brand-large { color: white; letter-spacing: 10px; font-weight: 900; animation: revealUp 1s forwards 0.8s; opacity: 0; }
.line, .line-large { width: 150px; height: 2px; background: #d4af37; margin: 15px auto; opacity: 0; animation: revealUp 1s forwards 1.1s; }

.mosque-city-mobile {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100px;
    background: #020617;
    clip-path: polygon(0% 100%, 10% 80%, 20% 95%, 30% 70%, 45% 95%, 55% 40%, 65% 95%, 80% 70%, 90% 95%, 100% 100%);
    opacity: 0.3;
}

.mosque-city-desktop {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 160px;
    background: #020617;
    clip-path: polygon(0% 100%, 5% 70%, 15% 40%, 25% 80%, 40% 10%, 55% 80%, 75% 30%, 90% 80%, 100% 100%);
    opacity: 0.3;
}
