/* ==========================================================================
   static/css/media.css - Estilos Mobile-First para Multimedia y Carruseles
   ========================================================================== */

/* Contenedor Base (Mobile First) */
.carousel-container {
    position: relative;
    width: 100%;
    background-color: #000; /* Fondo negro para que fotos verticales no desentonen */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9; /* Forzamos la proporción perfecta */
}

/* El Track ocupa todo el espacio disponible */
.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Transición suave de fundido (Fade In/Out) */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Imágenes responsivas sin recortes (contain) */
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    object-position: center;
}

/* Envoltorio seguro para iframes de YouTube */
.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================
   Controles de Navegación (Flechas y Puntos)
   ========================================== */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav:hover { background: rgba(0, 0, 0, 0.9); }
.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }

/* Puntitos Indicadores */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-indicators .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.carousel-indicators .dot.active {
    background: #ffffff;
    transform: scale(1.3);
}

/* ==========================================
   Botones de Lightbox (Expandir/Cerrar)
   ========================================== */
.carousel-expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.carousel-expand-btn:hover { background: var(--color-stripe, #3498db); }

.carousel-close-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 100000;
}

/* MODO FULLSCREEN */
.carousel-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 99999;
}

.carousel-container.fullscreen .carousel-expand-btn { display: none; }
.carousel-container.fullscreen .carousel-close-btn { display: block; }

/* ==========================================================
   TABLAS DINÁMICAS RESPONSIVAS (Data-to-Cards)
   ========================================================= */
.dynamic-table-container {
    width: 100%;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    background: #fff;
    overflow: hidden;
    border: 1px solid #054396; /* <-- NUEVO: Borde externo de la tabla completa */
}

.responsive-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
}

.responsive-data-table thead tr {
    background-color: var(--color-stripe);
    color: #fff;
}

.responsive-data-table th, 
.responsive-data-table td {
    padding: 12px 15px;
    border: 1px solid #ddd; /* <-- CAMBIO: Aplica borde vertical y horizontal (cuadrícula completa) */
}

.responsive-data-table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}

/* Fila de Agrupación (Ej: "Arqueros:") */
.table-group-header td {
    background-color: #f4f4f9;
    color: #00476b;
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
    padding-top: 1.5rem;
}

/* === MOBILE FIRST: Data-to-Cards === */
@media screen and (max-width: 768px) {
    .responsive-data-table thead {
        display: none; /* Ocultamos cabeceras en móvil */
    }

    .responsive-data-table tbody tr.table-data-row {
        display: block;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin: 10px;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        padding: 10px;
    }

    .responsive-data-table tbody tr.table-group-header {
        display: block;
        border: none;
        background: transparent;
        padding: 1.5rem 10px 0.5rem 10px;
    }

    .responsive-data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 5px;
        border: none; /* <-- NUEVO: Limpiamos la cuadrícula rígida de PC */
        border-bottom: 1px solid #f5f5f5; /* Restauramos solo la línea sutil separadora de la tarjeta */
        text-align: right;
    }

    .responsive-data-table td:last-child {
        border-bottom: none;
    }

    /* Genera el título virtual a la izquierda de la carta usando CSS */
    .responsive-data-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #575353;
        text-transform: uppercase;
        font-size: 0.75rem;
        margin-right: 15px;
        text-align: left;
        flex-basis: 40%;
        flex-shrink: 0;
    }
}