/* ========================================================
   STUDIO24TV — Public CSS
   Palette : noir + rouge (#e50914) + blanc
   ======================================================== */

:root {
    --bg-0: #050505;
    --bg-1: rgba(0, 0, 0, 0.85);
    --bg-2: rgba(255, 255, 255, 0.04);
    --bg-3: rgba(255, 255, 255, 0.08);
    --red: #e50914;
    --red-soft: rgba(229, 9, 20, 0.15);
    --red-glow: rgba(229, 9, 20, 0.6);
    --white: #fff;
    --text-1: rgba(255, 255, 255, 0.88);
    --text-2: rgba(255, 255, 255, 0.65);
    --text-3: rgba(255, 255, 255, 0.45);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(229, 9, 20, 0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background:
        radial-gradient(ellipse at top, rgba(229, 9, 20, 0.08), transparent 50%),
        radial-gradient(ellipse at bottom, rgba(20, 20, 30, 0.5), transparent 50%),
        var(--bg-0);
    color: var(--text-1);
    font-family: 'Helvetica Neue', 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }

/* ================ HEADER ================ */
@keyframes scanline {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}
@keyframes pulseBg {
    0%, 100% { background: rgba(0, 0, 0, 0.92); }
    50%      { background: rgba(35, 5, 5, 0.92); }
}
@keyframes pulseBgLive {
    0%, 100% { background: rgba(40, 5, 5, 0.95); }
    50%      { background: rgba(80, 10, 10, 0.95); }
}
@keyframes glitchAnim {
    0%, 92%, 100% { transform: translate(0); }
    93% { transform: translate(-2px, 1px); }
    94% { transform: translate(2px, -1px); }
    95% { transform: translate(-1px, 1px); }
    96% { transform: translate(1px, 0); }
}
@keyframes glitchRed {
    0%, 92%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); opacity: 0; }
    93% { clip-path: inset(20% 0 40% 0); transform: translate(-2px, 0); opacity: 0.8; }
    94% { clip-path: inset(50% 0 10% 0); transform: translate(2px, 0); opacity: 0.8; }
    95% { clip-path: inset(0 0 70% 0); transform: translate(-1px, 0); opacity: 0.6; }
    96% { opacity: 0; }
}
@keyframes glitchCyan {
    0%, 92%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); opacity: 0; }
    93% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 0); opacity: 0.8; }
    94% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, 0); opacity: 0.8; }
    95% { clip-path: inset(40% 0 30% 0); transform: translate(1px, 0); opacity: 0.6; }
    96% { opacity: 0; }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(229, 9, 20, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    animation: pulseBg 4s ease-in-out infinite;
}
.site-header.has-live {
    animation: pulseBgLive 1.6s ease-in-out infinite;
}
.site-header::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    animation: scanline 4s linear infinite;
    pointer-events: none;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    max-width: 1400px;
    margin: 0 auto;
    gap: 12px;
}

.site-logo {
    color: var(--white);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 1.5px;
    display: flex;
    align-items: baseline;
    text-decoration: none;
    position: relative;
}
.logo-text {
    position: relative;
    display: inline-block;
    animation: glitchAnim 7s infinite;
}
.logo-text::before,
.logo-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}
.logo-text::before {
    color: #e50914;
    animation: glitchRed 7s infinite;
    text-shadow: 2px 0 #e50914;
    mix-blend-mode: screen;
}
.logo-text::after {
    color: #00fff9;
    animation: glitchCyan 7s infinite;
    text-shadow: -2px 0 #00fff9;
    mix-blend-mode: screen;
}
.logo-accent { color: var(--red); }
.logo-ext { color: var(--text-3); font-size: 14px; margin-left: 4px; }

.header-search {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow: hidden;
    flex: 0 1 280px;
    transition: border-color 0.2s, background 0.2s;
}
.header-search:focus-within {
    border-color: var(--red);
    background: rgba(229, 9, 20, 0.06);
}
.header-search input {
    background: transparent;
    border: 0;
    color: var(--white);
    padding: 8px 12px;
    font-size: 13px;
    flex: 1;
    outline: none;
    min-width: 0;
}
.header-search input::placeholder { color: var(--text-3); }
.header-search button {
    background: transparent;
    border: 0;
    color: var(--text-2);
    padding: 0 10px;
    display: flex;
    align-items: center;
}
.header-search button:hover { color: var(--red); }

.header-menu-btn {
    display: none;
    background: transparent;
    border: 0;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}
.header-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    transition: transform 0.2s;
}

.site-nav {
    display: flex;
    gap: 6px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid var(--border);
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.nav-link {
    color: var(--text-2);
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--white); background: var(--bg-2); }
.nav-active { color: var(--red); font-weight: 500; }

/* ================ MAIN ================ */
.site-main { min-height: calc(100vh - 220px); padding-bottom: 40px; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

.page-title {
    color: var(--white);
    font-size: 24px;
    font-weight: 500;
    margin: 10px 0 20px;
}
.page-description {
    color: var(--text-2);
    margin: -10px 0 24px;
    font-size: 14px;
}
.empty-state {
    color: var(--text-3);
    text-align: center;
    padding: 60px 20px;
    font-size: 15px;
}

/* ================ GRILLE VIGNETTES ================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; gap: 14px; }
}

.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

@keyframes liveGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(229, 9, 20, 0);
        border-color: rgba(229, 9, 20, 0.5);
    }
    50% {
        box-shadow: 0 0 22px 2px rgba(229, 9, 20, 0.55);
        border-color: var(--red);
    }
}
.card-live {
    animation: liveGlow 2s ease-in-out infinite;
    grid-column: span 2;
}
@media (max-width: 900px) {
    .card-live { grid-column: span 1; }
}

.card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a0a0a, #0a0a1a);
    overflow: hidden;
}
.card-thumb-link {
    position: absolute;
    inset: 0;
    display: block;
}
.card-thumb-link img,
.card-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-video-preview {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.card-video-preview.playing { opacity: 1; }
.card-thumb-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.4);
}

@keyframes liveBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
.live-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: liveBlink 1.5s ease-in-out infinite;
    z-index: 2;
}
.live-dot {
    width: 6px; height: 6px;
    background: var(--white);
    border-radius: 50%;
}

.card-type-icon {
    position: absolute;
    bottom: 8px; left: 8px;
    background: rgba(0, 0, 0, 0.75);
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    z-index: 2;
}
.card-duration {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--white);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
}
.card-mute-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--white);
    width: 22px; height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.card-video-preview.playing ~ .card-mute-badge { display: flex; }

.card-info {
    display: block;
    padding: 10px 12px;
    color: var(--white);
}
.card-title {
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 5px;
    line-height: 1.3;
    color: var(--white);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-info:hover .card-title { color: var(--red); }
.card-meta {
    color: var(--text-3);
    font-size: 11px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.card-tag {
    background: var(--red-soft);
    color: #ff6b6b;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
}

/* ================ LOAD MORE ================ */
.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}
.load-more {
    background: transparent;
    border: 1px solid rgba(229, 9, 20, 0.5);
    color: var(--white);
    padding: 11px 28px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, border-color 0.15s;
}
.load-more:hover {
    background: var(--red-soft);
    border-color: var(--red);
}
.load-more.loading { opacity: 0.6; pointer-events: none; }
.load-more.loading svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================ DÉTAIL ================ */
.detail { max-width: 1100px; margin: 0 auto; }
.breadcrumb {
    color: var(--text-3);
    font-size: 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text-1); }

.detail-title {
    color: var(--white);
    font-size: 28px;
    font-weight: 500;
    margin: 0 0 12px;
    line-height: 1.15;
}

.detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.meta-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-2);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.meta-pill-red {
    background: var(--red-soft);
    border-color: rgba(229, 9, 20, 0.4);
    color: #ff6b6b;
}
.meta-pill:hover { border-color: rgba(255, 255, 255, 0.2); }

.player-wrap {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
    border: 1px solid var(--border);
}
.player-wrap video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}
.iframe-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
}
.iframe-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.live-banner {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--red);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
    animation: liveBlink 1.5s ease-in-out infinite;
}

.chapters-row {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 6px;
    -ms-overflow-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.chapter {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--text-1);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.chapter:hover { border-color: var(--border-hover); }
.chapter.active {
    border-color: var(--red);
    background: var(--red-soft);
    color: var(--white);
}
.chapter-label {
    color: var(--text-3);
    background: transparent;
    border: 0;
    cursor: default;
}
.chapter-time {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.chapter.active .chapter-time { color: rgba(255,255,255,0.7); }

.detail-content {
    color: var(--text-1);
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 24px;
    max-width: 720px;
}

.photos-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.photo-thumb {
    aspect-ratio: 4 / 3;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: block;
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.photo-thumb:hover img { transform: scale(1.05); }

.share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.share-url {
    flex: 1;
    color: var(--text-2);
    font-size: 12px;
    font-family: ui-monospace, 'SF Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.share-btn {
    background: var(--red);
    color: var(--white);
    border: 0;
    padding: 7px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
}
.share-btn:hover { background: #c0070f; }
.share-btn.copied { background: #1a8a47; }

/* ================ FOOTER ================ */
.site-footer {
    background: rgba(0, 0, 0, 0.92);
    border-top: 1px solid rgba(229, 9, 20, 0.2);
    margin-top: 40px;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}
.footer-block h4 {
    color: var(--red);
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.footer-block p {
    color: var(--text-2);
    font-size: 13px;
    margin: 0;
    line-height: 1.6;
}
.footer-legal {
    text-align: center;
    padding: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 11px;
}
.footer-legal a { color: var(--text-2); }
.footer-legal a:hover { color: var(--red); }

/* ================ 404 ================ */
.error-page {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-2);
}
.error-code {
    font-size: 96px;
    font-weight: 500;
    color: var(--red);
    line-height: 1;
    margin-bottom: 10px;
}
.error-page h1 {
    color: var(--white);
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 8px;
}
.error-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 22px;
    background: var(--red);
    color: var(--white);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}
.error-btn:hover { background: #c0070f; }

/* ================ RESPONSIVE ================ */
@media (max-width: 700px) {
    .header-inner { padding: 10px 14px; }
    .site-logo { font-size: 18px; }
    .site-nav { padding: 6px 14px; }
    .header-search { flex-basis: 160px; }
    .container { padding: 14px; }
    .detail-title { font-size: 22px; }
}
@media (max-width: 480px) {
    .header-search { display: none; }
    .site-header.search-open .header-search {
        display: flex;
        position: absolute;
        top: 100%; left: 0; right: 0;
        margin: 8px 14px;
    }
}
