/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222;
    --text: #eee;
    --text-muted: #999;
    --accent: #e74c3c;
    --radius: 10px;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === Header === */
#main-header {
    background: #111;
    border-bottom: 1px solid #222;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

#channel-logo {
    height: 32px;
    display: none;
}

#main-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* === Now Playing === */
#now-playing {
    max-width: 960px;
    margin: 20px auto 0;
    padding: 0 12px;
}

#now-playing.hidden {
    display: none;
}

.now-card {
    border: 1px solid var(--accent);
    background: var(--bg-card);
}

.now-card:hover {
    transform: none;
}

.now-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    color: #fff;
    white-space: nowrap;
}

.now-desc-visible {
    max-height: none !important;
    margin-top: 8px !important;
    color: #aaa;
}

#progress-bar-container {
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 4px;
}

#progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 1s linear;
}

#progress-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* === Controls === */
#controls {
    max-width: 960px;
    margin: 16px auto 0;
    padding: 0 12px;
}

.controls-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#search-bar {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: "Inter", sans-serif;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: var(--radius);
    color: #eee;
    outline: none;
    transition: border-color 0.2s;
}

#search-bar::placeholder {
    color: #666;
}

#search-bar:focus {
    border-color: var(--accent);
}

#category-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-btn {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    background: #1a1a1a;
    color: #999;
    border: 1px solid #333;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-btn:hover {
    background: #252525;
    color: #ccc;
}

.cat-btn.active {
    background: var(--cat-color, var(--accent));
    color: #fff;
    border-color: transparent;
}

/* === Event List === */
#event-list {
    max-width: 960px;
    margin: 16px auto;
    padding: 0 12px 40px;
}

.day-separator {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: capitalize;
    padding: 20px 0 8px;
    border-bottom: 1px solid #222;
    margin-bottom: 8px;
}

.no-results {
    text-align: center;
    color: #666;
    padding: 40px 0;
    font-size: 0.95rem;
}

/* === Event Card === */
.event-card {
    display: flex;
    gap: 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 8px;
    transition: background 0.2s, transform 0.15s;
}

.event-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(3px);
}

.event-thumb {
    width: 160px;
    min-height: 90px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-thumb {
    font-size: 2rem;
    opacity: 0.3;
}

.event-info {
    padding: 12px 14px 12px 0;
    flex: 1;
    min-width: 0;
}

.event-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.event-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.event-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.event-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.event-desc {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.5;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, margin 0.35s ease;
    margin-top: 0;
}

.event-card.expanded .event-desc {
    max-height: 300px;
    margin-top: 8px;
}

/* === Responsive === */
@media (max-width: 640px) {
    .now-card {
        flex-direction: column;
    }

    .now-card .event-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .now-card .event-info {
        padding: 10px 14px 14px;
    }

    .event-card.expanded {
        flex-direction: column;
    }

    .event-card.expanded .event-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .event-card.expanded .event-info {
        padding: 10px 14px 14px;
    }

    .event-title {
        font-size: 0.9rem;
    }

    #category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    #category-filters::-webkit-scrollbar {
        display: none;
    }
}
