/**
 * SalatKu - Theme Variables & Color System
 * All CSS custom properties for dynamic theming
 */

:root {
    /* Default Blue Theme */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --accent: #60a5fa;
    --accent-light: #93c5fd;
    --accent-dark: #2563eb;
    --text-accent: #dbeafe;
    
    /* UI Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --white: #ffffff;
    --black: #000000;
    
    /* Design System */
    --radius: 24px;
    --radius-sm: 16px;
    --radius-xs: 8px;
    
    /* Shadows */
    --shadow-sm: 0 4px 15px rgba(var(--shadow-color), 0.15);
    --shadow-md: 0 8px 25px rgba(var(--shadow-color), 0.2);
    --shadow-lg: 0 15px 40px rgba(var(--shadow-color), 0.25);
    --shadow-xl: 0 25px 50px rgba(var(--shadow-color), 0.3);
    --shadow-color: 30, 64, 175;
    
    /* Glass Morphism */
    --backdrop-blur: blur(20px);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    
    /* Background & Overlay */
    --body-bg: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
    --overlay-opacity: 0.3;
    
    /* Animation */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-theme: 0.8s ease-in-out;
}

/* Blue Theme (Default) */
.theme-gradient,
body:not([class*="theme-"]) {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --accent: #60a5fa;
    --accent-light: #93c5fd;
    --accent-dark: #2563eb;
    --text-accent: #dbeafe;
    --shadow-color: 30, 64, 175;
    --body-bg: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
    --overlay-opacity: 0;
}

/* Emerald Theme */
.theme-emerald {
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --accent: #34d399;
    --accent-light: #6ee7b7;
    --accent-dark: #059669;
    --text-accent: #a7f3d0;
    --shadow-color: 5, 150, 105;
    --body-bg: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%);
    --overlay-opacity: 0;
}

/* Purple Gradient Theme */
.theme-purple {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6b21a8;
    --accent: #a78bfa;
    --accent-light: #c4b5fd;
    --accent-dark: #7c3aed;
    --text-accent: #ddd6fe;
    --shadow-color: 124, 58, 237;
    --body-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --overlay-opacity: 0;
}

/* Pink Gradient Theme */
.theme-pink {
    --primary: #ec4899;
    --primary-light: #f472b6;
    --primary-dark: #be185d;
    --accent: #f9a8d4;
    --accent-light: #fbcfe8;
    --accent-dark: #ec4899;
    --text-accent: #fce7f3;
    --shadow-color: 236, 72, 153;
    --body-bg: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    --overlay-opacity: 0;
}

/* Orange Theme */
.theme-orange {
    --primary: #ea580c;
    --primary-light: #fb923c;
    --primary-dark: #c2410c;
    --accent: #fdba74;
    --accent-light: #fed7aa;
    --accent-dark: #ea580c;
    --text-accent: #fed7aa;
    --shadow-color: 234, 88, 12;
    --body-bg: linear-gradient(135deg, #fed7aa 0%, #fdba74 50%, #fb923c 100%);
    --overlay-opacity: 0;
}

/* Mosque Image Themes */
.theme-mosque1 {
    --primary: #f59e0b;
    --primary-light: #fbbf24;
    --primary-dark: #d97706;
    --accent: #fcd34d;
    --accent-light: #fde68a;
    --accent-dark: #f59e0b;
    --text-accent: #fef3c7;
    --shadow-color: 245, 158, 11;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid1.jpg');
    --overlay-opacity: 0.4;
}

.theme-mosque2 {
    --primary: #dc2626;
    --primary-light: #ef4444;
    --primary-dark: #991b1b;
    --accent: #f87171;
    --accent-light: #fca5a5;
    --accent-dark: #dc2626;
    --text-accent: #fecaca;
    --shadow-color: 220, 38, 38;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid2.jpg');
    --overlay-opacity: 0.4;
}

.theme-mosque3 {
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --accent: #34d399;
    --accent-light: #6ee7b7;
    --accent-dark: #059669;
    --text-accent: #a7f3d0;
    --shadow-color: 5, 150, 105;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid3.jpg');
    --overlay-opacity: 0.4;
}

/* Pure Image Themes (No Overlay) */
.theme-mosque1-pure {
    --primary: #b91c1c;
    --primary-light: #dc2626;
    --primary-dark: #991b1b;
    --accent: #ef4444;
    --accent-light: #f87171;
    --accent-dark: #b91c1c;
    --text-accent: #fecaca;
    --shadow-color: 185, 28, 28;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid1.jpg');
    --overlay-opacity: 0;
}

.theme-mosque2-pure {
    --primary: #1d4ed8;
    --primary-light: #2563eb;
    --primary-dark: #1e3a8a;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-dark: #1d4ed8;
    --text-accent: #dbeafe;
    --shadow-color: 29, 78, 216;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid2.jpg');
    --overlay-opacity: 0;
}

.theme-mosque3-pure {
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --accent: #34d399;
    --accent-light: #6ee7b7;
    --accent-dark: #059669;
    --text-accent: #a7f3d0;
    --shadow-color: 5, 150, 105;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid3.jpg');
    --overlay-opacity: 0;
}

.theme-mosque4-pure {
    --primary: #7c2d12;
    --primary-light: #9a3412;
    --primary-dark: #431407;
    --accent: #ea580c;
    --accent-light: #fb923c;
    --accent-dark: #7c2d12;
    --text-accent: #fed7aa;
    --shadow-color: 124, 45, 18;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid4.jpg');
    --overlay-opacity: 0;
}

.theme-mosque5-pure {
    --primary: #6b21a8;
    --primary-light: #7c3aed;
    --primary-dark: #581c87;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-dark: #6b21a8;
    --text-accent: #ddd6fe;
    --shadow-color: 107, 33, 168;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid5.jpg');
    --overlay-opacity: 0;
}

.theme-mosque6-pure {
    --primary: #be123c;
    --primary-light: #e11d48;
    --primary-dark: #9f1239;
    --accent: #f43f5e;
    --accent-light: #fb7185;
    --accent-dark: #be123c;
    --text-accent: #fecdd3;
    --shadow-color: 190, 18, 60;
    --body-bg: url('https://solat.aistudybuddy.my/assets/images/masjid6.jpg');
    --overlay-opacity: 0;
}

/* Dark Mode Themes */
.theme-dark {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --accent: #93c5fd;
    --accent-light: #bfdbfe;
    --accent-dark: #3b82f6;
    --text-accent: #dbeafe;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --shadow-color: 59, 130, 246;
    --body-bg: linear-gradient(135deg, #1f2937 0%, #111827 50%, #030712 100%);
    --overlay-opacity: 0;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

.theme-dark-green {
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --accent: #6ee7b7;
    --accent-light: #a7f3d0;
    --accent-dark: #10b981;
    --text-accent: #a7f3d0;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --shadow-color: 16, 185, 129;
    --body-bg: linear-gradient(135deg, #064e3b 0%, #022c22 50%, #052e16 100%);
    --overlay-opacity: 0;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* Special Event Themes */
.theme-ramadan {
    --primary: #7c2d12;
    --primary-light: #9a3412;
    --primary-dark: #431407;
    --accent: #ea580c;
    --accent-light: #fb923c;
    --accent-dark: #7c2d12;
    --text-accent: #fed7aa;
    --shadow-color: 124, 45, 18;
    --body-bg: linear-gradient(135deg, #451a03 0%, #7c2d12 50%, #ea580c 100%);
    --overlay-opacity: 0;
}

.theme-eid {
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --accent: #34d399;
    --accent-light: #6ee7b7;
    --accent-dark: #059669;
    --text-accent: #a7f3d0;
    --shadow-color: 5, 150, 105;
    --body-bg: linear-gradient(135deg, #064e3b 0%, #059669 50%, #34d399 100%);
    --overlay-opacity: 0;
}

/* High Contrast Theme (Accessibility) */
.theme-high-contrast {
    --primary: #000000;
    --primary-light: #374151;
    --primary-dark: #000000;
    --accent: #1f2937;
    --accent-light: #4b5563;
    --accent-dark: #000000;
    --text-accent: #ffffff;
    --text-primary: #000000;
    --text-secondary: #374151;
    --text-light: #6b7280;
    --shadow-color: 0, 0, 0;
    --body-bg: #ffffff;
    --overlay-opacity: 0;
    --glass-bg: rgba(0, 0, 0, 0.1);
    --glass-border: rgba(0, 0, 0, 0.3);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0s;
        --transition-normal: 0s;
        --transition-slow: 0s;
        --transition-theme: 0s;
    }
}

/* Print Styles */
@media print {
    :root {
        --body-bg: white !important;
        --text-primary: black !important;
        --text-secondary: #333 !important;
        --primary: black !important;
        --accent: #666 !important;
        --overlay-opacity: 0 !important;
    }
}

/* Theme Transition Animation */
body {
    transition: background var(--transition-theme);
}

* {
    transition-property: color, background-color, border-color, box-shadow, transform;
    transition-duration: var(--transition-normal);
    transition-timing-function: ease;
}

/* Color Scheme Support */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
    }
}

/* ===== PRAYER GRID SYSTEM WITH PULSING GOLD EFFECT ===== */

/* Prayer Times Section */
.prayer-section {
    padding: 0;
    background: rgba(0, 0, 0, 0.4) !important;
    border-top: 4px solid var(--primary);
    border-bottom: 4px solid var(--primary);
}

.prayer-grid {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(15px);
    padding: 30px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    position: relative;
    max-width: 100%;
    margin: 0;
}

.prayer-footer {
    text-align: center;
    padding: 20px 20px 40px;
    background: rgba(0, 0, 0, 0.3) !important;
}

/* Base Prayer Items */
.prayer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 18px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    position: relative;
    color: white !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.prayer-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Prayer Text Styling */
.prayer-name {
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #fcd34d !important;
    text-shadow: 
        1px 1px 0px rgba(0, 0, 0, 0.9),
        2px 2px 0px rgba(0, 0, 0, 0.7);
    filter: contrast(1.2) brightness(1.1);
}

.prayer-time {
    font-weight: 900;
    font-size: 26px;
    font-family: 'Poppins', sans-serif;
    color: #ffffff !important;
    text-shadow: 
        1px 1px 0px rgba(0, 0, 0, 0.9),
        2px 2px 0px rgba(0, 0, 0, 0.8),
        3px 3px 0px rgba(0, 0, 0, 0.6);
    filter: contrast(1.3) brightness(1.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.prayer-status {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-shadow: 
        1px 1px 0px rgba(0, 0, 0, 0.9),
        2px 2px 0px rgba(0, 0, 0, 0.7);
    filter: contrast(1.2);
}

/* Completed Prayers */
.prayer-item.completed {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3);
    opacity: 0.7;
}

.prayer-item.completed .prayer-status {
    color: #22c55e !important;
}

/* Next Prayer */
.prayer-item.next {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.5);
    transform: scale(1.05);
}

.prayer-item.next .prayer-status {
    color: #3b82f6 !important;
}

/* CURRENT PRAYER - PULSING GOLD EFFECT */
.prayer-item.current {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    transform: scale(1.08);
    border: 3px solid #f59e0b !important;
    animation: pulseGold 2s ease-in-out infinite !important;
    position: relative;
    z-index: 10;
}

/* Pulsing Gold Animation */
@keyframes pulseGold {
    0%, 100% { 
        border-color: #d97706 !important;
        box-shadow: 
            0 0 10px rgba(245, 158, 11, 0.3),
            0 6px 20px rgba(0, 0, 0, 0.25) !important;
    }
    50% { 
        border-color: #fbbf24 !important;
        box-shadow: 
            0 0 30px rgba(245, 158, 11, 0.8),
            0 0 50px rgba(245, 158, 11, 0.4),
            0 6px 20px rgba(0, 0, 0, 0.25) !important;
    }
}

.prayer-item.current:hover {
    transform: translateY(-4px) scale(1.1);
}

.prayer-item.current .prayer-status {
    color: #fbbf24 !important;
    text-shadow: 
        1px 1px 0px rgba(0, 0, 0, 0.9),
        2px 2px 0px rgba(0, 0, 0, 0.7);
    filter: contrast(1.3) brightness(1.2);
}

/* Upcoming Prayers */
.prayer-item.upcoming .prayer-status {
    color: #ffffff !important;
}

/* Desktop Responsive */
@media (min-width: 769px) {
    .prayer-name {
        font-size: 16px !important;
        font-weight: 900;
        letter-spacing: 1.4px;
    }

    .prayer-time {
        font-size: 28px !important;
        font-weight: 900;
    }

    .prayer-status {
        font-size: 12px !important;
        font-weight: 800;
        letter-spacing: 0.8px;
    }

    .prayer-item {
        padding: 28px 22px;
        gap: 14px;
    }

    .prayer-item.current {
        border: 4px solid #f59e0b !important;
        animation: pulseGold 2s ease-in-out infinite !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .prayer-section {
        background: rgba(0, 0, 0, 0.4) !important;
    }
    
    .prayer-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        padding: 20px 15px;
        gap: 12px;
        background: rgba(0, 0, 0, 0.5) !important;
    }
    
    .prayer-footer {
        background: rgba(0, 0, 0, 0.3) !important;
    }

    .prayer-item {
        padding: 16px 12px;
        gap: 6px;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 2px solid rgba(255, 255, 255, 0.15);
    }

    .prayer-item.current {
        transform: scale(1.05);
        border: 3px solid #f59e0b !important;
        animation: pulseGold 2s ease-in-out infinite !important;
        background: rgba(255, 255, 255, 0.15) !important;
    }

    .prayer-name {
        font-size: 12px !important;
        font-weight: 900;
        letter-spacing: 1px;
        text-shadow: 
            1px 1px 0px rgba(0, 0, 0, 0.9),
            2px 2px 0px rgba(0, 0, 0, 0.7);
        filter: contrast(1.2) brightness(1.1);
    }

    .prayer-time {
        font-size: 20px !important;
        font-weight: 900;
        text-shadow: 
            1px 1px 0px rgba(0, 0, 0, 0.9),
            2px 2px 0px rgba(0, 0, 0, 0.8),
            3px 3px 0px rgba(0, 0, 0, 0.6);
        filter: contrast(1.3) brightness(1.1);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .prayer-status {
        font-size: 10px !important;
        font-weight: 800;
        letter-spacing: 0.5px;
        text-shadow: 
            1px 1px 0px rgba(0, 0, 0, 0.9),
            2px 2px 0px rgba(0, 0, 0, 0.7);
        filter: contrast(1.2);
    }
    
    .prayer-item.completed .prayer-status {
        color: #22c55e !important;
    }

    .prayer-item.next .prayer-status {
        color: #3b82f6 !important;
    }

    .prayer-item.current .prayer-status {
        color: #fbbf24 !important;
        text-shadow: 
            1px 1px 0px rgba(0, 0, 0, 0.9),
            2px 2px 0px rgba(0, 0, 0, 0.7);
        filter: contrast(1.3) brightness(1.2);
    }

    .prayer-item.upcoming .prayer-status {
        color: #ffffff !important;
    }
}

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .prayer-name,
    .prayer-time,
    .prayer-status {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        filter: contrast(1.4) brightness(1.1);
    }
}

/* Disable animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .prayer-item.current {
        animation: none;
        transform: scale(1.08);
        border: 4px solid #f59e0b;
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    }
}

/* ===== END PRAYER GRID SYSTEM ===== */