/* =========================================
   Variables Globales (Surchargeables)
   ========================================= */
:root {
    --webtv-color-accent: #e74c3c;
    --webtv-color-bg-live: #fff0f0;
    --webtv-color-bg-past: #f9f9f9;
    --webtv-color-text-main: #333;
    --webtv-color-text-meta: #777;
    --webtv-border-radius: 8px;
    --webtv-spacing: 15px;
}

/* =========================================
   PLAYER
   ========================================= */
.webtv-player-wrapper {
    width: 100%;
    margin: 0 auto;
    background: #000;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    border-radius: var(--webtv-border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Écran d'attente */
.webtv-waiting-screen,
.webtv-offline-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: #111;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.webtv-waiting-content {
    animation: fadeIn 1s ease-out;
}

.webtv-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--webtv-color-accent);
    margin-bottom: 10px;
    font-weight: bold;
}

.webtv-title {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    /* Fallback size */
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
}

.webtv-time {
    font-size: 1.2em;
    color: #aaa;
}

/* =========================================
   PROGRAMME
   ========================================= */
.webtv-programme-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: inherit;
}

/* Filtres */
.webtv-filters {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.webtv-filter-btn {
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--webtv-color-text-main);
    transition: all 0.2s ease;
}

.webtv-filter-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: var(--webtv-color-text-main);
}

.webtv-filter-btn.active {
    background: var(--webtv-color-text-main);
    color: #fff;
    border-color: var(--webtv-color-text-main);
}

/* Liste */
.webtv-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.webtv-item {
    display: flex;
    padding: var(--webtv-spacing);
    border-radius: var(--webtv-border-radius);
    background: #fff;
    border-left: 4px solid transparent;
    border-top: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: transform 0.2s;
}

.webtv-item:hover {
    transform: translateX(5px);
}

/* États */
.webtv-item-live {
    background: var(--webtv-color-bg-live);
    border-left-color: var(--webtv-color-accent);
}

.webtv-item-past {
    background: var(--webtv-color-bg-past);
    border-left-color: #ddd;
    opacity: 0.7;
}

.webtv-item-future {
    border-left-color: #333;
}

/* Contenu Item */
.webtv-item-time {
    min-width: 80px;
    text-align: center;
    padding-right: 15px;
    border-right: 1px solid #eee;
    margin-right: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.webtv-item-day {
    font-size: 0.85em;
    text-transform: uppercase;
    color: var(--webtv-color-text-meta);
    margin-bottom: 2px;
}

.webtv-item-hour {
    font-weight: 800;
    font-size: 1.2em;
    color: var(--webtv-color-text-main);
}

.webtv-label-live {
    font-size: 10px;
    color: var(--webtv-color-accent);
    font-weight: bold;
    margin-top: 4px;
    animation: flash 2s infinite;
}

.webtv-item-content {
    flex-grow: 1;
}

.webtv-item-title {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: var(--webtv-color-text-main);
    font-weight: 600;
}

.webtv-item-meta {
    font-size: 0.9em;
    color: var(--webtv-color-text-meta);
}

/* Animations */
@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .webtv-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .webtv-item-time {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        margin-bottom: 10px;
        flex-direction: row;
        align-items: baseline;
        gap: 10px;
        width: 100%;
        justify-content: flex-start;
    }

    .webtv-item-day::after {
        content: " - ";
    }
}