/* CSS pour la section TV */
.tv-section {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    background: transparent;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tv-screen {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 2vw;
}

.tv-frame {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #444 0%, #111 100%);
    border: 0.5vw solid #000;
    border-radius: 3vw;
    box-shadow: 
        0 0 2vw rgba(0, 0, 0, 0.8),
        inset 0 0 3vw rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    animation: flicker 1.5s infinite;
}

.tv-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 2.5vw;
    box-shadow: inset 0 0 2vw rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 3;
}

.tv-frame::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0) 80%,
        rgba(255, 255, 255, 0.1) 100%
    );
    border-radius: 2.5vw;
    pointer-events: none;
    z-index: 3;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.04) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 2;
    animation: scroll 5s linear infinite;
    border-radius: 2.5vw;
}

.content {
    font-family: monospace;
    font-size: 2.5vw;
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #0f0;
    padding: 2vw;
    border-radius: 2.5vw;
}

.tv-article {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: none;
}

.tv-article.active {
    opacity: 1;
    z-index: 1;
}

/* Articles gérés par JavaScript */

.tv-article-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    z-index: 0;
    animation: slow-zoom 20s ease-in-out infinite alternate;
}

/* Filtre grayscale pour les images d'articles */
.tv-article-image.grayscale {
    filter: grayscale(100%);
    transition: filter 0.3s ease-in-out;
}

/* Arrière-plans semi-transparents pour les titres et extraits */
.tv-article > div.with-background {
    background: rgba(0, 0, 0, 0.4);
    padding: 1vw 2vw;
    border-radius: 0.5vw;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.tv-article-excerpt.with-background {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8vw 1.5vw;
    border-radius: 0.3vw;
    margin-top: 1vw;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.tv-article > div:not(.tv-article-image) {
    color: #e0e0e0;
    position: relative;
    margin-bottom: 1vw;
    z-index: 1;
    text-shadow: 0 0 10px rgba(224, 224, 224, 0.5);
    font-size: 3vw;
    text-align: center;
    max-width: 80%;
    opacity: 1;
    transition: none;
}

.tv-article-excerpt {
    font-size: 1.5vw;
    line-height: 1.4;
    margin-top: 2vw;
    max-width: 90%;
    opacity: 0.9;
    font-family: monospace;
    transition: none;
}

/* Glitch effect */
.glitch {
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    right: 0;
    color: #e0e0e0;
    background: #111;
    overflow: hidden;
    clip: rect(0, 900px, 0, 0);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #666;
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #999;
    animation: glitch-anim2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(42px, 9999px, 44px, 0); transform: skew(0.3deg); }
    5% { clip: rect(85px, 9999px, 90px, 0); transform: skew(0.2deg); }
    10% { clip: rect(10px, 9999px, 18px, 0); transform: skew(0.5deg); }
    15% { clip: rect(40px, 9999px, 42px, 0); transform: skew(0.1deg); }
    20% { clip: rect(60px, 9999px, 64px, 0); transform: skew(0.4deg); }
    100% { clip: rect(10px, 9999px, 80px, 0); transform: skew(0.2deg); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(12px, 9999px, 14px, 0); transform: skew(-0.3deg); }
    5% { clip: rect(45px, 9999px, 48px, 0); transform: skew(-0.2deg); }
    10% { clip: rect(20px, 9999px, 28px, 0); transform: skew(-0.5deg); }
    15% { clip: rect(50px, 9999px, 52px, 0); transform: skew(-0.1deg); }
    20% { clip: rect(30px, 9999px, 34px, 0); transform: skew(-0.4deg); }
    100% { clip: rect(0px, 9999px, 100px, 0); transform: skew(-0.2deg); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(1deg); }
    40% { transform: skew(-1deg); }
    60% { transform: skew(0.5deg); }
    80% { transform: skew(-0.5deg); }
    100% { transform: skew(0deg); }
}

@keyframes scroll {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.97; }
    55% { opacity: 0.9; }
    60% { opacity: 1; }
}

@keyframes slow-zoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

.tv-pagination {
    position: absolute;
    bottom: 2vw;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2vw;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.tv-pagination:hover {
    opacity: 1;
}

.tv-prev,
.tv-next {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(224, 224, 224, 0.5);
    color: rgba(224, 224, 224, 0.7);
    width: 2.5vw;
    height: 2.5vw;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9vw;
}

.tv-read-article {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(224, 224, 224, 0.5);
    color: rgba(224, 224, 224, 0.7);
    width: 2.5vw;
    height: 2.5vw;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9vw;
    text-decoration: none;
}

.tv-read-article:visited {
    color: rgba(224, 224, 224, 0.7) !important;
}

.tv-read-article:visited i {
    color: rgba(224, 224, 224, 0.7) !important;
}

.tv-prev:hover,
.tv-next:hover,
.tv-read-article:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(224, 224, 224, 0.8);
    color: rgba(224, 224, 224, 1);
    transform: scale(1.05);
}

/* Mobile styles */
@media (max-width: 768px) {
    .tv-section {
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        background: #111;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .content {
        font-size: 3.5vw;
    }

    .tv-screen {
        padding: 0 2vw;
        padding-top: 80px;
        height: 100vh;
        width: 100%;
        max-width: none;
        margin: 0;
        background: #111 !important;
    }

    .tv-frame {
        border-width: 0;
        border-radius: 4vw;
        height: 100%;
        box-shadow: inset 0 0 2vw rgba(0, 0, 0, 0.5) !important;
    }

    .tv-frame::before,
    .tv-frame::after,
    .scanlines,
    .content {
        border-radius: 3.5vw;
    }

    .glitch {
        font-size: 5vw;
        text-shadow: 0 0 8px rgba(224, 224, 224, 0.4);
    }

    .tv-article > div:not(.tv-article-image) {
        font-size: 5vw !important;
        max-width: 90%;
    }

    .tv-article-excerpt {
        font-size: 3vw !important;
        max-width: 95%;
        margin-top: 3vw;
    }

    .tv-pagination {
        bottom: 6vw;
        gap: 6vw;
    }

    .tv-prev,
    .tv-next,
    .tv-read-article {
        width: 12vw;
        height: 12vw;
        font-size: 4vw;
        border-width: 2px;
    }
}

@media (min-width: 783px) and (max-width: 900px) {
    .tv-section {
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        background: #111;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .tv-screen {
        padding: 0 2vw;
        padding-top: 80px;
        height: 100vh;
        width: 100%;
        max-width: none;
        margin: 0;
        background: #111 !important;
    }

    .tv-frame {
        border-width: 0;
        border-radius: 4vw;
        height: 100%;
        box-shadow: inset 0 0 2vw rgba(0, 0, 0, 0.5) !important;
    }

    .tv-frame::before,
    .tv-frame::after,
    .scanlines,
    .content {
        border-radius: 3.5vw;
    }

    .glitch {
        font-size: 5vw;
        text-shadow: 0 0 8px rgba(224, 224, 224, 0.4);
    }

    .tv-article > div:not(.tv-article-image) {
        font-size: 5vw !important;
        max-width: 90%;
    }

    .tv-article-excerpt {
        font-size: 3vw !important;
        max-width: 95%;
        margin-top: 3vw;
    }

    .tv-pagination {
        bottom: 6vw;
        gap: 6vw;
    }

    .tv-prev,
    .tv-next,
    .tv-read-article {
        width: 12vw;
        height: 12vw;
        font-size: 4vw;
        border-width: 2px;
    }
}
