/* RESET Y BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #ffffff !important;
    font-family: 'Ubuntu', sans-serif;
    font-weight: 300;
    line-height: 1.5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10px;
    min-height: 100vh;
}

.main-container {
    width: 100%;
    max-width: 960px;
    padding: 2px;
    padding-bottom: 50px;
}

/* --- TÍTULO Y ENLACES SUPERIORES --- */
.top-section {
    text-align: center;
    margin-bottom: 20px;
}

.main-title {
    font-size: 2em;
    color: #465661;
    font-weight: normal;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.history-nav {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.history-nav a {
    text-decoration: none;
    color: blue;
}

.history-nav a:hover { text-decoration: underline; }

/* --- ENCABEZADO TÉCNICO --- */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-bottom: 5px;
}

.header-left { 
    text-align: left; 
    white-space: nowrap;
}

.header-right { 
    text-align: right; 
    white-space: nowrap;
}

.info-line {
    font-size: 1rem; 
    color: #333;
    font-weight: 300;
}

/* --- VIDEO WRAPPER (4:3) --- */
.video-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 4 / 3;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-bottom: 10px;
}

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

/* --- ENLACE WEB DEBAJO DE LA IMAGEN --- */
.web-link-container {
    text-align: center;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 20px;
}

.web-link {
    font-size: 1rem; 
    color: blue;
    text-decoration: none;
    font-weight: normal;
}

.web-link:hover {
    text-decoration: underline;
}

/* --- SEGURIDAD --- */
.video-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1020;
    background: rgba(0,0,0,0);
    pointer-events: auto;
}

/* --- MÁSCARA BLUR --- */
.privacy-polygon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    pointer-events: none;
    clip-path: polygon(
        37% 48%, 51% 50%, 70% 48%, 70% 54%, 
        87% 55%, 80% 60%, 59% 58%, 59% 72%, 37% 60%
    );
}

/* --- SECCIÓN INFERIOR CENTRADA --- */
.bottom-section {
    text-align: center;
    font-size: 1rem;
    margin-top: 20px;
}

.bottom-section p {
    margin-bottom: 1rem;
}

.bottom-section a {
    color: blue;
    text-decoration: underline;
}

.bottom-section a:hover {
    text-decoration: none;
}

.chart-container {
    text-align: center;
    margin: 20px 0;
}

.chart-container img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

.footer-banner img {
    border: 0;
    max-width: 100%;
    height: auto;
}

/* --- RESPONSIVE GENERAL --- */
@media (max-width: 800px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 15px;
    }

    .header-left, .header-right {
        text-align: center;
        width: 100%;
        white-space: normal;
        margin-bottom: 5px;
    }
    
    .info-line {
        font-size: 1rem;
    }
}

/* =========================================
   BLOQUEO DE MODO HORIZONTAL (LANDSCAPE)
   Doble seguridad: CSS + JS
   ========================================= */

/* Estilo base del aviso (oculto) */
#rotate-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    color: #fff;
    z-index: 2147483647; /* Máximo valor posible */
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.warning-content h1 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.warning-content p {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Regla CSS de respaldo por si el JS tarda un milisegundo */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .main-container {
        display: none !important;
    }
    
    /* Nota: El display:flex del aviso lo gestiona mejor el JS, 
       pero podemos forzarlo aquí también si queremos */
    #rotate-warning {
        display: flex !important;
    }
}
