:root { 
    /* --- LIGHT THEME (Frosted Ice) --- */
    /* Background Mesh Gradient Colors */
    --bg-color: #f0f4f8;
    --blob-1: rgba(251, 191, 36, 0.4); /* Amber/Sun */
    --blob-2: rgba(59, 130, 246, 0.4); /* Blue/Sky */
    --blob-3: rgba(236, 72, 153, 0.3); /* Pink/Sunrise */
    
    /* Glass Cards */
    --card-bg: rgba(255, 255, 255, 0.45); /* More transparent for glass effect */
    --card-border: rgba(255, 255, 255, 0.8); /* Strong white highlight */
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    /* Typography */
    --text-primary: #1e293b; 
    --text-secondary: #475569; 
    
    /* Elements */
    --accent-bg: rgba(255, 255, 255, 0.6);
    --border-theme: rgba(255, 255, 255, 0.6);
    --divider-color: rgba(148, 163, 184, 0.3);
    
    /* Toggle */
    --toggle-bg: rgba(255, 255, 255, 0.6);
    --toggle-icon: #f59e0b;
    
    /* Segment Control */
    --seg-bg: rgba(226, 232, 240, 0.6);
    --seg-btn-active: #ffffff;
    --seg-text: #64748b;
    --seg-text-active: #0f172a;
    --seg-shadow: 0 4px 6px rgba(0,0,0,0.05);

    /* Timeline */
    --timeline-line: #cbd5e1;
    --timeline-active-bg: rgba(255, 255, 255, 0.6);
    
    /* Status Gradients */
    --status-on-gradient: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
    --status-off-gradient: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%);
    
    --modal-overlay: rgba(241, 245, 249, 0.6);
    
    --btn-donat-bg: rgba(255, 255, 255, 0.7);
    --btn-donat-border: rgba(255, 255, 255, 0.9);
    --btn-donat-text: #334155;
}

html.dark {
    /* --- DARK THEME (Smoked Glass) --- */
    --bg-color: #0f172a;
    --blob-1: rgba(245, 158, 11, 0.15); /* Amber glow */
    --blob-2: rgba(37, 99, 235, 0.2); /* Deep Blue */
    --blob-3: rgba(88, 28, 135, 0.25); /* Deep Purple */
    
    /* Glass Cards */
    --card-bg: rgba(30, 41, 59, 0.4); /* Dark semi-transparent */
    --card-border: rgba(255, 255, 255, 0.1); /* Subtle edge */
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    /* Typography */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Elements */
    --accent-bg: rgba(255, 255, 255, 0.05);
    --border-theme: rgba(255, 255, 255, 0.1);
    --divider-color: rgba(255, 255, 255, 0.1);
    
    /* Toggle */
    --toggle-bg: rgba(255, 255, 255, 0.1);
    --toggle-icon: #fbbf24;

    /* Segment Control */
    --seg-bg: rgba(0, 0, 0, 0.2);
    --seg-btn-active: rgba(255, 255, 255, 0.1);
    --seg-text: #94a3b8;
    --seg-text-active: #ffffff;
    --seg-shadow: 0 4px 12px rgba(0,0,0,0.3);

    /* Timeline */
    --timeline-line: #334155;
    --timeline-active-bg: rgba(255, 255, 255, 0.07);

    /* Status */
    --status-on-gradient: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(0,0,0,0));
    --status-off-gradient: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(0,0,0,0));
    
    --modal-overlay: rgba(0, 0, 0, 0.6);
    
    --btn-donat-bg: rgba(30, 41, 59, 0.6);
    --btn-donat-border: rgba(255, 255, 255, 0.1);
    --btn-donat-text: #cbd5e1;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.5s ease;
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scroll from blobs */
}

/* --- BACKGROUND BLOBS FOR GLASS EFFECT --- */
.ambient-light {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 1;
    transition: background-color 0.5s ease;
}
.blob-1 {
    top: -10%; left: -10%; width: 50vw; height: 50vw;
    background-color: var(--blob-1);
    animation: float 20s infinite ease-in-out alternate;
}
.blob-2 {
    bottom: 10%; right: -10%; width: 60vw; height: 60vw;
    background-color: var(--blob-2);
    animation: float 25s infinite ease-in-out alternate-reverse;
}
.blob-3 {
    top: 40%; left: 30%; width: 40vw; height: 40vw;
    background-color: var(--blob-3);
    animation: float 18s infinite ease-in-out alternate;
}

/* Modern Card with Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    /* Double border trick for inner highlight */
    box-shadow: var(--card-shadow), inset 0 0 0 1px rgba(255,255,255,0.05); 
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Status Styles */
.status-hero.on {
    background: var(--status-on-gradient);
    border-color: rgba(34, 197, 94, 0.4);
}
.status-hero.off {
    background: var(--status-off-gradient);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Utility Color Classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.bg-accent { background-color: var(--accent-bg); }
.border-theme { border-color: var(--border-theme); }

/* Segmented Control */
.segmented-control {
    background-color: var(--seg-bg);
    padding: 4px;
    border-radius: 16px;
    display: flex;
    position: relative;
    /* Inner shadow for depth */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.segment-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--seg-text);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}
.segment-btn.active {
    color: var(--seg-text-active);
    background-color: var(--seg-btn-active);
    box-shadow: var(--seg-shadow);
}

/* Timeline List */
.timeline-container { position: relative; }
.timeline-line {
    position: absolute;
    left: 23px; top: 24px; bottom: 24px;
    width: 2px;
    background: var(--timeline-line);
    z-index: 0;
    opacity: 0.5;
}

.timeline-item {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 12px 16px;
    border-radius: 16px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}

.timeline-item.active {
    background: var(--timeline-active-bg);
    border-color: var(--card-border);
    backdrop-filter: blur(4px);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.timeline-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--bg-color); 
    transition: box-shadow 0.3s;
}
/* Update mask when theme changes */
body.dark .timeline-dot { box-shadow: 0 0 0 4px #0f172a; } 

.dot-on { background-color: #22c55e; }
.dot-off { background-color: #ef4444; }

.timeline-item.active .dot-on { box-shadow: 0 0 0 4px var(--card-bg), 0 0 12px #22c55e; }
.timeline-item.active .dot-off { box-shadow: 0 0 0 4px var(--card-bg), 0 0 12px #ef4444; }

.time-range {
    font-family: 'Inter', monospace;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.02em;
}
.timeline-item.active .time-range {
    color: var(--text-primary);
    font-weight: 800;
}

/* Theme Toggle Button */
.theme-btn {
    background: var(--toggle-bg);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.theme-btn:hover {
    transform: translateY(-2px);
    color: var(--toggle-icon);
    background: var(--card-bg);
}

/* Animations */
@keyframes float { 0% { transform: translateY(0px) scale(1); } 50% { transform: translateY(-20px) scale(1.05); } 100% { transform: translateY(0px) scale(1); } }

@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.pulse-active.dot-on { animation: pulse-ring 2s infinite; }

@keyframes pulse-ring-red { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.pulse-active.dot-off { animation: pulse-ring-red 2s infinite; }

/* Donat Button Theming */
.btn-donat {
    background-color: var(--btn-donat-bg);
    color: var(--btn-donat-text);
    border: 1px solid var(--btn-donat-border);
    backdrop-filter: blur(10px);
}
.btn-donat:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background-color: var(--card-bg);
}

.btn-home-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}
.btn-home-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

/* Modal Styles */
.modal-overlay {
    background-color: var(--modal-overlay);
    backdrop-filter: blur(8px);
}
.queue-btn {
    background-color: var(--accent-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.queue-btn:hover {
    background-color: var(--card-bg);
    border-color: #f59e0b;
    color: #f59e0b;
}
.queue-btn.current {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.animate-scale-in { animation: scaleIn 0.2s ease-out forwards; }

/* Remove border outline from date badge */
#mobile-schedule-date,
#schedule-date-label {
    border: none !important;
}

/* Status Main Label */
.status-main-label {
    color: #ffffff !important;
}
html:not(.dark) .status-main-label,
html.light-theme .status-main-label {
    color: #0f172a !important;
}

/* Transparent Icon Wrap & Radiating Animation */
.status-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    position: relative;
}

.status-icon-wrap::before,
.status-icon-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.status-icon-wrap.status-on-wrap::before {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.65) 0%, rgba(245, 158, 11, 0.25) 50%, rgba(245, 158, 11, 0) 100%);
    animation: lightRadiate 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.status-icon-wrap.status-on-wrap::after {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.5) 0%, rgba(245, 158, 11, 0.2) 50%, rgba(245, 158, 11, 0) 100%);
    animation: lightRadiate 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1) 1.2s;
}

.status-icon-wrap.status-on-wrap #main-status-icon {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.9));
    animation: iconGlowPulseOn 2s infinite ease-in-out alternate;
}

.status-icon-wrap.status-off-wrap::before {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(248, 113, 113, 0.55) 0%, rgba(239, 68, 68, 0.25) 50%, rgba(239, 68, 68, 0) 100%);
    animation: lightRadiate 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.status-icon-wrap.status-off-wrap::after {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(248, 113, 113, 0.45) 0%, rgba(239, 68, 68, 0.2) 50%, rgba(239, 68, 68, 0) 100%);
    animation: lightRadiate 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1) 1.2s;
}

.status-icon-wrap.status-off-wrap #main-status-icon {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8));
    animation: iconGlowPulseOff 2s infinite ease-in-out alternate;
}

@keyframes lightRadiate {
    0% {
        width: 30px;
        height: 30px;
        opacity: 0.95;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

@keyframes iconGlowPulseOn {
    0% {
        filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 18px rgba(251, 191, 36, 1));
        transform: scale(1.08);
    }
}

@keyframes iconGlowPulseOff {
    0% {
        filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.9));
        transform: scale(1.06);
    }
}/* BASE THEME ICON VISIBILITY */
#icon-sun, #icon-moon,
.theme-toggle .icon-sun, .theme-toggle .icon-moon,
.theme-btn .icon-sun, .theme-btn .icon-moon {
    display: none;
}

/* DARK THEME: SUN ICON (☀️) IS SHOWN */
html.dark-theme #icon-sun, html.dark #icon-sun,
html.dark-theme .theme-toggle .icon-sun, html.dark .theme-toggle .icon-sun,
html:not(.light-theme):not(.light) #icon-sun,
html:not(.light-theme):not(.light) .theme-toggle .icon-sun {
    display: block !important;
}

html.dark-theme #icon-moon, html.dark #icon-moon,
html.dark-theme .theme-toggle .icon-moon, html.dark .theme-toggle .icon-moon,
html:not(.light-theme):not(.light) #icon-moon,
html:not(.light-theme):not(.light) .theme-toggle .icon-moon {
    display: none !important;
}

/* LIGHT THEME: MOON ICON (🌙) IS SHOWN */
html.light-theme #icon-moon, html.light #icon-moon,
html.light-theme .theme-toggle .icon-moon, html.light .theme-toggle .icon-moon {
    display: block !important;
}

html.light-theme #icon-sun, html.light #icon-sun,
html.light-theme .theme-toggle .icon-sun, html.light .theme-toggle .icon-sun {
    display: none !important;
}

/* --- PWA INSTALL BANNER --- */
.pwa-install-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    z-index: 99999;
    width: calc(100% - 32px);
    max-width: 440px;
    background: var(--card-bg, rgba(30, 41, 59, 0.85));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.15));
    border-radius: 20px;
    padding: 12px 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    pointer-events: none;
}

.pwa-install-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.pwa-banner-icon {
    font-size: 22px;
    width: 42px;
    height: 42px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-banner-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pwa-banner-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-desc {
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.35;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-btn-install {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 800;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.pwa-btn-install:hover {
    background: #d97706;
}

.pwa-btn-install:active {
    transform: scale(0.95);
}

.pwa-btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: color 0.2s, background-color 0.2s;
}

.pwa-btn-close:hover {
    color: var(--text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.1);
}

/* --- FOOTER STYLES --- */
.footer-queue-link {
    display: block;
    padding: 9px 10px;
    border-radius: 12px;
    background: var(--accent-bg, rgba(30, 41, 59, 0.5));
    border: 1px solid var(--border-theme, rgba(255, 255, 255, 0.08));
    color: var(--text-primary, #e2e8f0);
    font-weight: 700;
    font-size: 0.825rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.footer-queue-link:hover {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
    color: #fbbf24 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

/* --- LIGHT THEME STYLES FOR FOOTER --- */
html.light-theme footer .card,
html.light footer .card {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(203, 213, 225, 0.8) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04) !important;
}

html.light-theme .footer-queue-link,
html.light .footer-queue-link {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(203, 213, 225, 0.9) !important;
    color: #0f172a !important;
}

html.light-theme .footer-queue-link:hover,
html.light .footer-queue-link:hover {
    background: rgba(245, 158, 11, 0.2) !important;
    border-color: #d97706 !important;
    color: #78350f !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25) !important;
}

html.light-theme footer h3,
html.light footer h3 {
    color: #b45309 !important;
}

html.light-theme footer .disclaimer-box,
html.light footer .disclaimer-box {
    background: #ffffff !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #1e293b !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}

html.light-theme footer .disclaimer-box span,
html.light footer .disclaimer-box span {
    color: #0f172a !important;
}

html.light-theme footer .disclaimer-box svg,
html.light footer .disclaimer-box svg {
    color: #d97706 !important;
}

html.light-theme footer .badge-hold-on,
html.light footer .badge-hold-on {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b !important;
    color: #78350f !important;
}

html.light-theme footer .slava-ukraini-badge,
html.light footer .slava-ukraini-badge {
    background: linear-gradient(135deg, #dbeafe, #fef3c7) !important;
    border: 1px solid #f59e0b !important;
    color: #78350f !important;
}

html.light-theme footer .patriotic-text,
html.light footer .patriotic-text {
    color: #0f172a !important;
}

html.light-theme footer .footer-subtext,
html.light footer .footer-subtext {
    color: #334155 !important;
}

html.light-theme footer .footer-subtext strong,
html.light footer .footer-subtext strong {
    color: #0f172a !important;
}



