/* css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

:root {
    /* New Theme: Blue/White (Inspired by Demo) */
    --primary: #0066cc; /* Bright blue for active/accents */
    --primary-dark: #004499; /* Dark blue for marquee */
    --secondary: #10b981;
    --bg-color: #f1f5f9; /* Light slate background */
    --text-main: #1e293b; /* Dark slate text */
    --text-muted: #64748b; /* Lighter text */
    --card-bg: #ffffff; /* Solid white cards */
    --card-border: #e2e8f0; /* Subtle borders */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden; /* Hide scrollbars for TV */
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Islamic Pattern Background */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M50 0 L100 50 L50 100 L0 50 Z" fill="none" stroke="rgba(0,0,0,0.02)" stroke-width="2"/></svg>');
    background-size: 100px 100px;
    z-index: -1;
}

/* Solid Card (replaces glass-card for the new theme) */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border, #e2e8f0);
    color: var(--text-main);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.blue-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: 1px solid var(--primary-dark);
    border-radius: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

.clock-container {
    container-type: size;
}
.clock-text {
    font-size: clamp(2rem, min(15cqw, 40cqh), 7rem);
    font-weight: 900;
    line-height: 1;
    color: var(--text-main);
    letter-spacing: -2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.05);
}
.date-text {
    font-size: clamp(0.75rem, min(4cqw, 15cqh), 1.5rem);
    font-weight: 600;
    color: var(--text-muted);
}

/* Prayer Times */
.prayer-box {
    transition: all 0.3s ease;
    border-radius: 1rem;
}
.prayer-box.active {
    background: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}
.prayer-box.active .prayer-name, .prayer-box.active .prayer-time {
    color: #ffffff !important;
}
.prayer-name {
    font-size: clamp(0.75rem, 2vmin, 1.25rem);
    font-weight: 600;
    color: var(--text-muted);
}
.prayer-time {
    font-size: clamp(1.25rem, 4vmin, 2.5rem);
    font-weight: 800;
    color: var(--text-main);
}
.next-prayer-highlight {
    animation: pulse 2s infinite;
}

/* Slider */
.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
}
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
}
.slide.active {
    opacity: 1;
}

/* Running Text */
.marquee-container {
    background: var(--primary-dark);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 600;
    padding: 0.75rem 0;
    overflow: hidden;
    white-space: nowrap;
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
}

/* Top Students List */
.student-rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
}
.rank-1 { background: #fbbf24; color: #000; }
.rank-2 { background: #94a3b8; color: #000; }
.rank-3 { background: #b45309; color: #fff; }
.rank-other { background: rgba(255,255,255,0.2); }

/* Modes Overlay */
#mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
#mode-overlay.show, .show {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Keyframes */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* Themes */
/* Theme Variables */
.theme-hijau-islami {
    --bg-color: #f1f5f9;
    --primary: #047857;
    --primary-dark: #064e3b;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-border: #e2e8f0;
}
.theme-biru {
    --bg-color: #f1f5f9;
    --primary: #0066cc;
    --primary-dark: #004499;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-border: #e2e8f0;
}
.theme-emas {
    --bg-color: #111118;
    --primary: #d4a017;
    --primary-dark: #9e750e;
    --card-bg: #1e1e2d;
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --card-border: rgba(212, 160, 23, 0.3);
}
.theme-hitam {
    --bg-color: #05050a;
    --primary: #374151;
    --primary-dark: #1f2937;
    --card-bg: #121218;
    --text-main: #ffffff;
    --text-muted: #d1d5db;
    --card-border: rgba(255,255,255,0.15);
}
.theme-putih {
    --bg-color: #ffffff;
    --primary: #475569;
    --primary-dark: #334155;
    --card-bg: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #475569;
    --card-border: #cbd5e1;
}
.theme-dark {
    --bg-color: #020617;
    --primary: #3b82f6;
    --primary-dark: #1e3a8a;
    --card-bg: #0f172a;
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --card-border: rgba(59, 130, 246, 0.3);
}

/* Utility overrides for light theme */
body.theme-putih .clock-text, body.theme-putih .date-text { color: var(--text-main); text-shadow: none; }
body.theme-putih .prayer-name { color: var(--text-muted); }
body.theme-putih .prayer-time { color: var(--text-main); }
body.theme-putih .marquee-container { background: var(--text-main); color: #fff; }
