/* Modern UI Redesign - Dark Cinematic / Emergency Theme */

:root {
    /* Color Palette - Dark & Neon */
    --bg-page: #020617;
    /* Slate 950 - Deepest Dark */
    --bg-surface: rgba(30, 41, 59, 0.7);
    /* Slate 800 - Glassy */
    --bg-surface-hover: rgba(51, 65, 85, 0.8);
    /* Slate 700 */

    --primary: #ef4444;
    /* Red 500 - Neon Emergency */
    --primary-glow: rgba(239, 68, 68, 0.5);
    --primary-dark: #b91c1c;
    /* Red 700 */

    --accent: #3b82f6;
    /* Blue 500 - Police Lights Accent */
    --accent-glow: rgba(59, 130, 246, 0.4);

    --text-main: #f8fafc;
    /* Slate 50 - Pure White */
    --text-muted: #94a3b8;
    /* Slate 400 - Light Grey */

    --border-light: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(239, 68, 68, 0.5);

    /* Shadows & Glows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-glow-red: 0 0 20px var(--primary-glow);
    --shadow-glow-blue: 0 0 20px var(--accent-glow);

    /* Radius */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    /* Subtle gradient background */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(220, 38, 38, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar - Floating Glass */
.navbar {
    position: sticky;
    top: 20px;
    z-index: 50;
    margin: 0 1rem;
    background: rgba(15, 23, 42, 0.6);
    /* Very dark glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Changed to space-between for better mobile */
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px var(--primary-glow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-title span {
    color: var(--primary);
}

.nav-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Main Content */
.main-content {
    padding: 0 1.5rem 3rem;
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* Header Banner */
.header-banner {
    text-align: center;
    margin: 3rem 0 5rem;
    position: relative;
}

/* Decorate background behind title */
.header-banner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 100px;
    background: var(--primary);
    filter: blur(80px);
    opacity: 0.2;
    z-index: -1;
}

.banner-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    /* Gradient Text */
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.banner-desc {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 40px var(--primary-glow);
}

.btn-primary svg {
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

/* Calendar Card */
.calendar-wrapper {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 4rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

/* Top bar accent for calendar */
.calendar-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.current-month {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.month-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.month-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding-bottom: 1rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
}

.calendar-day:hover:not(.empty) {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.1);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

/* Today State */
.calendar-day.current-day {
    background: rgba(59, 130, 246, 0.2);
    /* Blue tint for today */
    border: 1px solid var(--accent);
    color: var(--text-main);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Event State */
.calendar-day.has-event {
    color: var(--text-main);
    font-weight: 700;
    background: rgba(220, 38, 38, 0.1);
    /* Red tint */
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.calendar-day.has-event:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.event-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    margin-top: 8px;
    box-shadow: 0 0 8px var(--primary);
}

/* Episodes List */
.episodes-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    border-radius: 2px;
}

.episodes-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.episode-card {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0) 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 2rem;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* Hover effect on card */
.episode-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.episode-card:hover {
    transform: translateX(10px);
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.episode-card:hover::before {
    opacity: 1;
}

.episode-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    line-height: 1.3;
    padding-right: 2rem;
    border-right: 1px solid var(--border-light);
}

.episode-info {
    padding-right: 1rem;
}

.episode-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.episode-card:hover .episode-title {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.episode-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.past-episode {
    opacity: 0.5;
    filter: grayscale(1);
}

.past-episode:hover {
    opacity: 1;
    filter: grayscale(0);
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
    border-top: 1px solid var(--border-light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* Darker backdrop */
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-light);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transform: scale(0.95);
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Modal header color accent */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

@keyframes zoomIn {
    to {
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.modal-body {
    padding: 3rem 2.5rem 2.5rem;
    /* More top padding */
}

.modal-body h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-detail-row {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border-light);
    display: flex;
    gap: 1rem;
    color: var(--text-main);
}

.modal-detail-row strong {
    color: var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-width: 90px;
    position: relative;
    top: 3px;
    /* visual alignment */
}

/* Responsiveness */
@media (max-width: 768px) {
    .banner-title {
        font-size: 2.5rem;
    }

    .calendar-wrapper {
        padding: 1.5rem;
    }

    .calendar-day,
    .month-nav-btn {
        width: auto;
        height: auto;
    }

    .episode-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }

    .episode-date {
        flex-direction: row;
        gap: 1rem;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 0.75rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }
}