/* --- General & Display Page Styles --- */
html, body {
    height: 100%;
    /* Cambio a Montserrat como fuente principal corporativa */
    font-family: 'Montserrat', Arial, sans-serif; 
    color: #000000;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
ol, ul {
    margin:0;
}
body.display-page {
    /* Azul corporativo muy oscuro en lugar de gris oscuro */
    background-color: #061024; 
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: hidden!important;
}

/* Contenedor principal */
.airshow-display-container {
    flex-grow: 1;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

/* --- Header Styles --- */
.header {
    /* Azul institucional */
    background-color: #001A33; 
    border-bottom: 3px solid #FFC300; /* Borde un poco más grueso */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
    height: 12vh !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* Sombra para dar profundidad */
}

.header .logo img {
    height: 80px!important;
}

img#currentExhibitionFlag {
    max-height: 80px!important;
}

.header .exhibition-title {
    font-size: 1.5rem !important;
    color: #FFFFFF;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    text-align: center;
    font-weight: 700; /* Negrita más marcada */
    flex-grow: 1;
    line-height: 1.2;
    text-transform: uppercase; /* Toque más institucional */
    letter-spacing: 1px;
}

.header .country-flag img {
    height: 60px!important;
    border: 1px solid #334;
    border-radius: 4px; /* Bordes ligeramente redondeados */
}

/* --- Main Content Area --- */
.main-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.main-content .schedule-section {
    width: 50% !important;
    flex-basis: 50% !important;
    max-width: 50% !important;
    height: 80vh !important;
}

/* --- Aircraft Photo Section --- */
.aircraft-photo-section {
    width: 100%;
    min-height: 150px;
    background-size: cover;
    background-position: center;
    /* Fondo azul profundo en lugar del marrón/granate */
    background-color: #0B132B; 
    background-image: url('/wp-content/plugins/jornadas/images/default-background.jpg');
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem;
    flex-shrink: 0;
}

.image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}
.image-status-messages {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}
.at-display-now,
.no-active-patrol-message {
    background-color: rgba(0, 26, 51, 0.85); /* Fondo azul translúcido */
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    font-size: 1.5em;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    width: 90%;
    position: absolute;
    top: 10px;
    border: 1px solid rgba(255, 195, 0, 0.3); /* Toque de borde amarillo */
}

.at-display-now {
    color: #00E5FF; /* Cian tecnológico en lugar de verde básico */
    animation: flash 1.5s infinite;
    position: absolute;
    top: 0;
}

.no-active-patrol-message {
    color: #F5F5F5;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Schedule Section Styles --- */
.schedule-section {
    width: 100%;
    /* Fondo azul profundo */
    background-color: #0B132B; 
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    flex-grow: 1;
    position: relative;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.schedule-list {
    scrollbar-width: none;
}
.schedule-list::-webkit-scrollbar {
    display: none;
}

.schedule-title {
    font-size: 1.2rem !important;
    color: #FFC300 !important; /* Título en amarillo BACSI */
    border-bottom: 2px solid #FFC300;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.schedule-list {
    list-style: none;
    padding-left: 0;
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 100px;
    padding-bottom: 20px;
    padding-top: 10px;
}

/* --- Schedule Item Styling (ESTILO UNIFICADO) --- */
.schedule-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 10px; 
    gap: 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    /* Fondo de tarjeta en azul pizarra */
    background-color: #1C2541; 
    color: #F5F5F5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3), inset 0 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: opacity 0.9s ease-in-out, transform 0.9s ease-in-out, box-shadow 0.9s ease-in-out;
    transform-origin: center center;
    
    font-size: 0.95rem !important; 
    line-height: 1.3em !important;
    
    max-width: 98%;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
}

.status-dot, .status-indicator {
    margin-top: 6px; 
}

.schedule-item:last-child {
    margin-bottom: 0;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 3px 1px rgba(224, 219, 207, 0.3);
    transition: background-color 0.9s ease-in-out, box-shadow 0.9s ease-in-out;
}

.team-details {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    gap: 10px !important;
    flex-wrap: nowrap;
}

.team-name {
    font-size: 1.1em; 
    font-weight: 600;
    color: #FFFFFF;
}
.time-slot {
    font-size: 0.9em;
    font-weight: bold !important;
    white-space: nowrap;
    color: #FFC300; /* Hora destacada en amarillo */
}

/* --- Media Queries --- */
@media (min-width: 768px) {
    .main-content {
        flex-direction: row;
    }
    .aircraft-photo-section {
        width: 30%;
        min-height: 400px;
    }
    .at-display-now,
    .no-active-patrol-message {
        font-size: 2em;
    }
    .schedule-section {
        width: 70%;
        padding: 1.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .header .exhibition-title {
        font-size: 2em !important;
        line-height: 40px;
    }
    .schedule-title {
        font-size: 1.5rem !important;
    }
    
    .schedule-item {
        font-size: 1rem !important;
        padding: 10px 12px;
        margin-bottom: 6px;
    }

    .schedule-content-container {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        gap: 4px;
    }
    .item-type {
        font-size: 0.9em;
        font-style: italic;
        color: #001A33; /* Texto oscuro para fondo claro */
        background-color: #E0E6ED; /* Fondo gris/azulado claro */
        padding: 2px 8px;
        border-radius: 10px;
    }
    .top-line {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .status-dot {
        width: 10px;
        height: 10px;
        margin-right: 10px;
    }
    .status-dot, .status-indicator {
        margin-top: 8px;
    }
    .team-name {
        font-size: 1.2em; 
        margin-right: 5px;
    }
}

@media only screen and (max-width: 768px) {
    .main-content .schedule-section {
        width: 100% !important;
        flex-basis: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 575.98px) {
    .schedule-section {
        padding-bottom: 70px !important;
    }
    .header .exhibition-title {
        font-size: 1rem !important;
    }
    .aircraft-photo-section {
        min-height: 120px;
        padding: 0.5rem;
    }
    .at-display-now, .no-active-patrol-message {
        font-size: 1.2em;
        padding: 0.4rem 0.8rem;
    }
    .schedule-title {
        font-size: 1.5rem !important;
    }
    
    .schedule-item {
        font-size: 0.9em !important;
        padding: 6px 8px;
    }
    
    .team-name {
        font-size: 1.1em;
    }
    .time-slot {
        font-size: 0.9em;
    }
    .airshow-display-container {
        padding-bottom: 120px;
    }
}

/* --- Status Colors & Glows --- */
.status-indicator {
    width: auto;
    height: auto;
    background-color: transparent;
    border: none;
    border-radius: 0;
    margin-right: 5px;
    flex-shrink: 0;
    color: #E0DBCF;
    font-size: 1em;
    line-height: 1;
    text-align: center;
    font-weight: bold;
    min-width: 10px;
}

.schedule-item.status-active-now .team-name {
    color: #00E5FF; /* Cian tecnológico en lugar de verde pastel */
}
.schedule-item.status-cancelled .team-name,
.schedule-item.status-cancelled .time-slot {
    color: #FF6B6B; /* Rojo más vivo */
    text-decoration: line-through;
}
.schedule-item.status-past {
    opacity: 0.5;
}
.schedule-item.status-past .team-name,
.schedule-item.status-past .time-slot {
    color: #8C9BAB; /* Gris azulado */
}

/* Active Item Glow */
.schedule-item.is-active {
    box-shadow:
        inset 0 0 2px 1px rgba(255, 255, 255, 0.2), 
        0 0 10px 3px rgba(0, 229, 255, 0.6),
        0 0 20px 5px rgba(0, 229, 255, 0.4);
    border: 1px solid rgba(0, 229, 255, 0.5); /* Borde extra para resaltar */
}
.schedule-item.is-active .status-dot {
    background-color: rgba(0, 229, 255, 0.95);
    box-shadow:
        0 0 10px 3px rgba(0, 229, 255, 0.9),
        0 0 20px 5px rgba(0, 229, 255, 0.7);
}

/* Status Specific Glows */
.schedule-item.status-active-now {
    box-shadow:
        inset 0 0 1px 1px rgba(255, 255, 255, 0.15),
        0 0 2px 3px rgba(0, 229, 255, 0.5),
        0 0 2px 3px rgba(0, 229, 255, 0.3);
}
.status-dot.status-active-now-dot {
    background-color: rgba(0, 229, 255, 0.85);
    box-shadow:
        0 0 6px 2px rgba(0, 229, 255, 0.75),
        0 0 12px 4px rgba(0, 229, 255, 0.55);
}

.schedule-item.status-upcoming {
     box-shadow:
        inset 0 0 1px 1px rgba(255, 255, 255, 0.1),
        0 0 4px 1px rgba(255, 255, 255, 0.1);
}
.status-dot.status-upcoming-dot {
    background-color: rgba(224, 219, 207, 0.8);
    box-shadow:
        0 0 4px 1px rgba(224, 219, 207, 0.5);
}

.schedule-item.status-delayed {
     box-shadow:
        inset 0 0 1px 1px rgba(255, 255, 255, 0.08),
        0 0 2px 3px rgba(255, 195, 0, 0.5); /* Amarillo BACSI */
}
.status-dot.status-delayed-dot {
    background-color: rgba(255, 195, 0, 0.8);
    box-shadow:
        0 0 6px 2px rgba(255, 195, 0, 0.7),
        0 0 12px 4px rgba(255, 195, 0, 0.5);
}

.schedule-item.status-cancelled {
     box-shadow:
        inset 0 0 1px 1px rgba(255, 255, 255, 0.05),
        0 0 6px 2px rgba(255, 107, 107, 0.5);
      opacity: 0.75;
}
.status-dot.status-cancelled-dot {
    background-color: rgba(255, 107, 107, 0.8);
    box-shadow:
        0 0 6px 2px rgba(255, 107, 107, 0.75);
    opacity: 0.75;
}

.schedule-item.status-change {
     box-shadow:
        inset 0 0 1px 1px rgba(255, 255, 255, 0.1),
        0 0 7px 2px rgba(255, 153, 0, 0.5); /* Naranja intenso */
}
.status-dot.status-change-dot {
    background-color: rgba(255, 153, 0, 0.85);
    box-shadow:
        0 0 6px 2px rgba(255, 153, 0, 0.75);
}

.schedule-item.status-past {
    box-shadow: none;
    background-color: #151D33; /* Aún más oscuro para los pasados */
    opacity: 0.65; 
}
.status-dot.status-past-dot {
    background-color: rgba(140, 155, 171, 0.5);
    box-shadow: none; 
}
.schedule-item.status-default-state {
     box-shadow:
        inset 0 0 1px 1px rgba(200, 200, 200, 0.1),
        0 0 4px 1px rgba(0, 0, 0, 0.4);
}
.status-dot.status-default-state-dot {
    background-color: rgba(200, 200, 200, 0.5);
}

/* --- Legend --- */
.schedule-legend {
    background-color: #001A33; /* Azul institucional */
    padding: 10px 0;
    border-top: 1px solid #1C2541;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px 25px;
    font-size: 0.9em;
    box-sizing: border-box;
    border-bottom: 2px solid #FFC300; /* Línea de cierre corporativa */
    height: 8vh !important;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.legend-text {
    color: #F5F5F5;
    font-size: 1.7em;
    font-weight: bold;
}

@media (max-width: 767.98px) {
    .schedule-legend {
        font-size: 0.8em;
        gap: 8px;
        justify-content: space-around;
        padding: 8px 0;
    }
    .legend-item {
        flex-basis: calc(50% - 16px);
        justify-content: center;
    }
    .legend-dot {
        width: 8px;
        height: 8px;
        margin-right: 6px;
    }
    .legend-text {
        font-size: 1.5em;
    }
}

/* --- Animations --- */
#scheduleList.list-exiting {
    opacity: 0;
    transform: translateY(20px) scaleY(0.98);
}
.schedule-item.item-entering {
    opacity: 0;
    transform: translateX(-15px);
}
.schedule-item.item-exiting {
    opacity: 0;
    transform: scale(0.95);
}

/* --- Admin Page Styles --- */
body.admin-page { 
    font-family: 'Montserrat', Arial, sans-serif; 
    margin: 20px; 
    background-color: #F0F4F8; /* Gris azulado muy claro */
}
.admin-container { 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Sombra más suave y moderna */
    max-width: 900px; 
    margin: auto; 
    border-top: 4px solid #001A33; /* Detalle corporativo en la parte superior */
}
.admin-container h1, .admin-container h2 { color: #001A33; margin-bottom: 15px; border-bottom: 2px solid #F0F4F8; padding-bottom: 10px; }
.admin-form label { display: block; margin-bottom: 5px; font-weight: 600; color: #333; }
.admin-form input[type="text"], .admin-form input[type="time"], .admin-form select, .admin-form input[type="file"] { width: calc(100% - 22px); padding: 10px; margin-bottom: 15px; border: 1px solid #CBD5E1; border-radius: 4px; transition: border-color 0.3s; }
.admin-form input:focus, .admin-form select:focus { outline: none; border-color: #001A33; }
.admin-form button { background-color: #001A33; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s;}
.admin-form button:hover { background-color: #003366; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { border: 1px solid #E2E8F0; padding: 10px; text-align: left; }
.admin-table th { background-color: #F8FAFC; color: #001A33; font-weight: bold; }
.admin-table .action-links a, .admin-table .action-links button { color: #0055A4; text-decoration: none; margin-right: 10px; background: none; border: none; cursor: pointer; padding: 0; font-size: 1em; font-family: 'Montserrat', sans-serif; font-weight: 600;}
.admin-table .action-links a:hover, .admin-table .action-links button:hover { text-decoration: underline; color: #003366; }
.admin-table .action-links button.delete { color: #E53E3E; }
.message { padding: 10px; margin-bottom: 15px; border-radius: 4px; }
.message.success { background-color: #C6F6D5; color: #22543D; border: 1px solid #9AE6B4; }
.message.error { background-color: #FED7D7; color: #822727; border: 1px solid #FEB2B2; }
hr { margin: 20px 0; border: 0; border-top: 1px solid #E2E8F0; }

/* --- Speaker & Room Fields --- */
.speaker-name, .speaker-position {
    display: block;
    width: 100%;
    text-align: left;
}

.speaker-name {
    font-size: 0.9em; 
    font-weight: bold;
    color: #FFFFFF;
}

.speaker-position {
    font-size: 0.85em; 
    font-style: italic;
    color: #A0AAB5; /* Gris claro azulado */
    margin-bottom: 5px;
}

.schedule-item.is-active .speaker-name {
    color: #00E5FF; /* Acorde al brillo cian */
}

.schedule-item.is-active .speaker-position {
    color: #E0DBCF;
}

.top-line-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.top-line-right {
    display: flex;
    align-items: center;
}

.room-location {
    font-size: 0.9em; 
    font-weight: 500;
    color: #FFC300; /* Amarillo para destacar las salas */
    font-style: italic;
}

.schedule-item.is-active .room-location {
    color: #FFFFFF;
}

/* --- Estilos para el Carrusel Horizontal --- */
.carousel-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    display: none;
    border-radius: 8px;
    flex-shrink: 0;
}

.carousel-container.has-items {
    display: block;
}

.carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.8s ease-in-out;
}

.carousel-item-wrapper {
    min-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 10px 1px !important;
}

.carousel-item-wrapper .schedule-item {
    margin-bottom: 0;
    height: 100%;
}

.carousel-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFC300, transparent);
    margin: 5px 0 15px 0;
    opacity: 0.6;
    display: none;
}
.carousel-divider.visible {
    display: block;
}

/* --- AJUSTES DEL CARRUSEL --- */
.carousel-item-wrapper .schedule-item {
    min-height: 100px; 
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-item-wrapper .team-name {
    font-weight: 700;
    margin-bottom: 4px;
}

@media (max-width: 768px) {
    .carousel-item-wrapper .schedule-item {
        min-height: 90px;
    }
}


/* --- Corrección para evitar el recorte de la luz en el carrusel activo --- */

.carousel-item-wrapper {
    /* Aumentamos el espacio vertical a 25px para que la sombra (glow) 
       de 20px+5px tenga espacio suficiente y no choque con el overflow: hidden */
    padding: 25px 1px !important; 
}

.carousel-item-wrapper .schedule-item {
    /* Cambiamos el height de 100% a auto. Así garantizamos que la tarjeta 
       pueda crecer verticalmente de forma natural si añades 2, 3 o más ponentes. */
    height: auto !important; 
    
    /* Mantenemos un tamaño mínimo para que no se vea muy pequeña si hay poco texto */
    min-height: 100px; 
}