/* TV Content Manager — Optimizado para TCL 32" vertical 768×1366 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    /* Base 16px en 768px ancho → escala bien en TV de 32" */
    font-size: clamp(13px, 2.1vw, 18px);
    overflow-x: hidden;
}

.page-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px 24px;
}

/* Header */
.header { display: none; }

.header h1 {
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    font-weight: 600;
    background: linear-gradient(90deg, #00d4ff, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-admin { display: none; }

/* Secciones */
.section {
    margin-bottom: 40px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
}

.section-label { padding: 16px 24px 0; }

.section-tag {
    display: inline-block;
    padding: 5px 16px;
    background: linear-gradient(90deg, #00d4ff22, #7c3aed22);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 20px;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #00d4ff;
}

/* SECCIÓN 1 — YouTube */
.section-youtube { padding-bottom: 20px; }

.youtube-wrapper {
    position: relative;
    width: 100%;
    /* height inyectada por PHP inline */
    margin-top: 16px;
    background: #000;
}

.youtube-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

/* SECCIÓN 2 — Acordeón */
.section-accordion { padding-bottom: 20px; }

.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px 0;
}

.accordion-item {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    overflow: visible;
    border: 1px solid rgba(255,255,255,0.08);
}

.accordion-header {
    display: flex;
    align-items: center;
    padding: 18px 22px;
    cursor: pointer;
    transition: background 0.3s;
}
.accordion-header:hover { background: rgba(255,255,255,0.05); }
.accordion-header.active {
    background: rgba(0,212,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.accordion-title {
    flex: 1;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    font-weight: 500;
}

.accordion-count {
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: rgba(255,255,255,0.45);
    margin-right: 14px;
}

.accordion-icon { transition: transform 0.3s; font-size: 0.8rem; }
.accordion-header.active .accordion-icon { transform: rotate(180deg); }

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-out;
}
/* max-height.show inyectada por PHP inline */

/* Media Slider */
.media-slider {
    position: relative;
    width: 100%;
    background: #000;
}

.media-item {
    display: none;
    width: 100%;
}

.media-item.active {
    display: block;
    animation: sliderFadeIn 0.5s ease;
}

@keyframes sliderFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.media-content {
    width: 100%;
    height: auto;
    display: block;
}

.media-item video.media-content {
    width: 100%;
    height: auto;
    max-height: 80vh;
}

.media-title {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 16px 22px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
}

.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px;
    background: rgba(0,0,0,0.3);
}

.slider-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}
.slider-btn:hover { background: rgba(255,255,255,0.22); }

.slider-dots { display: flex; gap: 10px; }
.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background 0.3s;
}
.dot.active { background: #00d4ff; }

.no-media {
    padding: 50px;
    text-align: center;
    color: rgba(255,255,255,0.45);
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
}

.no-content { text-align: center; padding: 60px 20px; }
.no-content a { color: #00d4ff; text-decoration: none; }

/* SECCIÓN 3 — Video local */
.section-video { padding-bottom: 20px; }

.local-video-wrapper { margin-top: 16px; background: #000; }
.local-video-wrapper video {
    width: 100%;
    display: block;
    object-fit: cover;
    /* max-height inyectada por PHP inline */
}

.video-caption {
    padding: 16px 22px;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.07);
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 20px;
    gap: 18px;
    color: rgba(255,255,255,0.4);
}
.placeholder-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.btn-upload {
    padding: 12px 26px;
    background: rgba(0,212,255,0.12);
    border: 1px solid rgba(0,212,255,0.4);
    color: #00d4ff;
    text-decoration: none;
    border-radius: 8px;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    transition: background 0.3s;
}
.btn-upload:hover { background: rgba(0,212,255,0.25); }

/* Footer */
.footer { display: none; }
.footer-hidden {
    text-align: center;
    padding: 28px 0;
    color: rgba(255,255,255,0.3);
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    margin-top: 8px;
}

/* TV vertical — landscape override desactivado */
@media (orientation: portrait) {
    .page-wrapper { padding: 12px 16px; }
}

@media (max-width: 768px) {
    .header h1 { font-size: 1.3rem; }
    .accordion-header { padding: 14px 16px; }
    .section-label { padding: 12px 16px 0; }
    .accordion-container { padding: 12px 16px 0; }
}
