/**
 * estilo-camaras.css
 * Estilos específicos para la sección de Cámaras en Vivo
 * Extiende estilo-base.css con componentes de cámaras
 */

/* ============================================================
   PATRÓN DE FONDO (heredado del sitio principal)
   ============================================================ */
.bg-pattern {
    position: fixed;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ============================================================
   HEADER DE CÁMARAS
   ============================================================ */
.cam-header {
    position: relative;
    z-index: 1;
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(100, 149, 237, 0.12);
}

.cam-header-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.cam-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0.5rem 0 0.3rem;
    background: linear-gradient(90deg, #e8ecf1 0%, #87CEEB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cam-subtitle {
    font-size: 1rem;
    color: #7a9ab8;
    margin: 0;
}

/* Header compacto para vista individual */
.cam-header-compact {
    position: relative;
    z-index: 1;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(100, 149, 237, 0.12);
    background: rgba(10, 22, 40, 0.7);
}

.cam-header-compact h1 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 600;
    margin: 0.3rem 0;
    color: #e8ecf1;
}

.cam-header-compact p {
    font-size: 0.85rem;
    color: #7a9ab8;
    margin: 0;
}

.cam-grupo {
    display: inline-block;
    font-size: 0.75rem;
    color: #87CEEB;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(42, 90, 138, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

/* ============================================================
   GRUPOS DE CÁMARAS
   ============================================================ */
.cam-main {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.cam-grupo {
    margin-bottom: 2.5rem;
}

.grupo-header {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(100, 149, 237, 0.1);
}

.grupo-header h2 {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 600;
    color: #c8d8ec;
    margin: 0 0 0.3rem;
}

.grupo-desc {
    font-size: 0.9rem;
    color: #6a8caf;
    margin: 0;
}

/* ============================================================
   GRID DE TARJETAS
   ============================================================ */
.cam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
}

/* ============================================================
   TARJETA DE CÁMARA
   ============================================================ */
.cam-card {
    background: linear-gradient(145deg, rgba(20, 40, 70, 0.8) 0%, rgba(15, 30, 55, 0.9) 100%);
    border: 1px solid rgba(100, 149, 237, 0.12);
    border-radius: 14px;
    padding: 1.3rem;
    transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cam-card:hover {
    border-color: rgba(100, 149, 237, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.cam-card-header {
    margin-bottom: 1rem;
}

.cam-numero {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6a8caf;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.cam-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #c8d8ec;
    margin: 0 0 0.3rem;
    line-height: 1.3;
}

.cam-desc {
    font-size: 0.82rem;
    color: #7a9ab8;
    margin: 0;
    line-height: 1.4;
}

/* ============================================================
   PREVIEW DE CÁMARA
   ============================================================ */
.cam-preview {
    flex: 1;
    min-height: 160px;
    background: rgba(10, 22, 40, 0.5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid rgba(100, 149, 237, 0.08);
    overflow: hidden;
}

.cam-preview > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #4a5a70;
}

.cam-preview svg {
    opacity: 0.5;
}

.cam-preview span {
    font-size: 0.8rem;
    opacity: 0.7;
}

.cam-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Colores de acento por tipo */
.preview-hls { color: #7dd8a8; }
.preview-youtube { color: #d4a5c0; }
.preview-rtn { color: #e8c87a; }
.preview-generic { color: #87CEEB; }

/* ============================================================
   ACCIONES DE TARJETA
   ============================================================ */
.cam-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-ver,
.btn-mapa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid;
}

.btn-ver {
    background: rgba(42, 90, 138, 0.25);
    color: #87CEEB;
    border-color: rgba(42, 90, 138, 0.3);
}

.btn-ver:hover {
    background: rgba(42, 90, 138, 0.45);
    transform: translateY(-1px);
}

.btn-mapa {
    background: rgba(90, 90, 138, 0.2);
    color: #b0b0d8;
    border-color: rgba(90, 90, 138, 0.25);
}

.btn-mapa:hover {
    background: rgba(90, 90, 138, 0.4);
}

/* ============================================================
   VARIANTES DE COLOR POR TARJETA
   ============================================================ */
.card-azul { border-left: 3px solid #2a5a8a; }
.card-rosa { border-left: 3px solid #8a4a6a; }
.card-verde { border-left: 3px solid #2a7a5a; }
.card-violeta { border-left: 3px solid #5a5a8a; }
.card-amb { border-left: 3px solid #8a6a2a; }
.card-oro { border-left: 3px solid #8a7a3a; }


/* ============================================================
   REPRODUCTOR INLINE (nuevo)
   ============================================================ */

.cam-preview {
    flex: 1;
    min-height: 160px;
    background: rgba(10, 22, 40, 0.5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid rgba(100, 149, 237, 0.08);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.cam-preview:hover {
    border-color: rgba(100, 149, 237, 0.25);
}

.cam-preview.playing {
    cursor: default;
    border-color: rgba(100, 149, 237, 0.35);
}

/* Overlay con ícono */
.preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: rgba(10, 22, 40, 0.4);
    transition: opacity 0.3s ease;
}

.preview-overlay > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.preview-overlay svg {
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cam-preview:hover .preview-overlay svg {
    opacity: 0.9;
    transform: scale(1.1);
}

.preview-overlay span {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Contenedor del reproductor inline */
.player-container {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #000;
}

.player-container video,
.player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Error inline */
.player-error-inline {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(138, 42, 42, 0.9);
    color: #e8c8c8;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    z-index: 10;
}

/* Miniatura RTN en overlay */
.preview-rtn img {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
    opacity: 0.7;
    border-radius: 6px;
}

/* ============================================================
   REPRODUCTOR INDIVIDUAL
   ============================================================ */
.camara-individual {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.cam-player-container {
    flex: 1;
    position: relative;
    z-index: 1;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.player-wrapper {
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.player-wrapper video,
.player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.youtube-wrapper,
.iframe-wrapper {
    background: #0a0a0a;
}

/* RTN Banner */
.rtn-banner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 2;
}

.rtn-banner img {
    max-width: 60%;
    max-height: 40%;
    object-fit: contain;
    opacity: 0.8;
}

.btn-rtn-play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #1e5aa8 0%, #2a7cc7 100%);
    color: #fff;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(42, 124, 199, 0.3);
}

.btn-rtn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(42, 124, 199, 0.4);
}

.btn-rtn-play:active {
    transform: scale(0.98);
}

.rtn-banner p {
    color: #7a9ab8;
    font-size: 0.85rem;
    margin: 0;
}

.rtn-video-container {
    width: 100%;
    height: 100%;
}

.rtn-video-container video {
    width: 100%;
    height: 100%;
}

/* Error de reproducción */
.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(138, 42, 42, 0.9);
    color: #e8c8c8;
    padding: 2rem;
    text-align: center;
    font-size: 1rem;
    z-index: 10;
}

/* ============================================================
   ACCIONES DEL REPRODUCTOR
   ============================================================ */
.cam-player-actions {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(10, 22, 40, 0.8);
    border-top: 1px solid rgba(100, 149, 237, 0.1);
    flex-wrap: wrap;
}

/* ============================================================
   FOOTER
   ============================================================ */
.cam-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid rgba(100, 149, 237, 0.1);
    background: rgba(10, 22, 40, 0.5);
}

.cam-footer .btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(42, 90, 138, 0.25);
    color: #87CEEB;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid rgba(42, 90, 138, 0.3);
    transition: all 0.2s ease;
}

.cam-footer .btn-volver:hover {
    background: rgba(42, 90, 138, 0.45);
    transform: translateY(-2px);
}

.update-info {
    font-size: 0.75rem;
    color: #4a5a70;
    margin: 1rem 0 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .cam-header {
        padding: 1.5rem 1rem 1rem;
    }

    .cam-grid {
        grid-template-columns: 1fr;
    }

    .cam-card {
        padding: 1rem;
    }

    .player-wrapper {
        aspect-ratio: 4 / 3;
    }

    .cam-player-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cam-player-actions .btn-mapa,
    .cam-player-actions .btn-volver {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .cam-header h1 {
        font-size: 1.4rem;
    }

    .cam-card h3 {
        font-size: 0.95rem;
    }

    .player-wrapper {
        aspect-ratio: 1 / 1;
        border-radius: 0;
    }

    .cam-main {
        padding: 1rem 0.75rem 2rem;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .cam-card,
    .btn-ver,
    .btn-mapa,
    .btn-volver,
    .btn-rtn-play {
        transition: none !important;
    }
}
