/* Estilo general para el body */
body {
    width: 1900px;
    height: 1200px;
    margin: 0 auto; /* Centra el body horizontalmente */
    padding: 0;
    font-family: 'Arial', sans-serif; /* Fuente profesional */
    background-color: #f4f4f9; /* Color de fondo suave */
}

/* Estilo para el encabezado */
header {
    position: fixed;
    top: 0;
    left: 0; /* Asegura que el header ocupe todo el ancho de la pagina */
    width: 100%; /* Ancho completo de la pagina */
    height: 35px; /* Altura del header */
    background-color: #2c3e50; /* Azul oscuro profesional */
    color: white; /* Texto blanco */
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center; /* Centra el contenido horizontalmente */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra ligera */
    z-index: 1000; /* Prioridad visual */
}

/* Estilo para el nav (contenedor del menu) */
nav {
    width: 100%; /* Ocupa todo el ancho del header */
    display: flex;
    justify-content: center; /* Centra los elementos del menu */
}

/* Lista principal del menu */
.menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding-top: 3px;
    gap: 20px; /* Espaciado entre elementos */
    height: 20px;
}

/* Estilo para los elementos del menu */
.menu li {
    color: white; /* Texto blanco */
    font-size: 12px; /* Tamano del texto */
    cursor: pointer;
    position: relative; /* Necesario para posicionar el submenu */
    transition: color 0.24s ease, text-shadow 0.24s ease;
}

/* Efecto hover para los elementos */
.menu li:hover {
    color: #f1c40f; /* Cambia el color al pasar el cursor */
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.2);
}

/* Submenus */
.submenu {
    list-style: none;
    margin: 0; /* Elimina margen adicional */
    padding: 0; /* Elimina el relleno interno */
    background-color: #2c3e50; /* Fondo igual al header */
    position: absolute; /* Posicion relativa al elemento padre */
    top: calc(100% + 0px); /* Mismo anclaje que ahora */
    left: 0; /* Alineado al inicio del elemento padre */
    display: block; /* Se deja visible para poder animarlo */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(0.97);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16); /* Sombra elegante */
    border-radius: 5px; /* Bordes redondeados */
    z-index: 999; /* Prioridad visual */
    margin-top: -4px;
    overflow: visible;
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.28s ease,
        box-shadow 0.28s ease;
}

/* Evitar que desaparezca el submenu */
.menu li:hover > .submenu,
.menu li:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

/* Elementos del submenu */
.submenu li {
    padding: 5px 10px; /* Relleno para el texto */
    white-space: nowrap; /* Evita cortes en el texto */
    color: white;
    opacity: 0;
    transform: translateX(-8px);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        background-color 0.16s ease,
        color 0.16s ease;
}

.menu li:hover > .submenu > li,
.menu li:focus-within > .submenu > li {
    opacity: 1;
    transform: translateX(0);
}

.submenu li:nth-child(1) { transition-delay: 0.02s; }
.submenu li:nth-child(2) { transition-delay: 0.05s; }
.submenu li:nth-child(3) { transition-delay: 0.08s; }
.submenu li:nth-child(4) { transition-delay: 0.11s; }
.submenu li:nth-child(5) { transition-delay: 0.14s; }
.submenu li:nth-child(6) { transition-delay: 0.17s; }
.submenu li:nth-child(7) { transition-delay: 0.20s; }
.submenu li:nth-child(8) { transition-delay: 0.23s; }
.submenu li:nth-child(9) { transition-delay: 0.26s; }
.submenu li:nth-child(10) { transition-delay: 0.29s; }

.submenu li a {
    display: block;
}

.menu a:focus-visible,
.submenu-group-trigger:focus-visible {
    outline: none;
    color: #f6d76a;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.24);
}

.submenu li a:focus-visible,
.submenu-group-trigger:focus-visible {
    border-radius: 4px;
}

.submenu li:hover {
    background-color: #34495e; /* Efecto hover */
    color: #f6d76a;
    transform: translateX(4px);
}

.submenu-group {
    padding-right: 26px;
}

.submenu-group::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -16px;
    width: 20px;
    height: calc(100% + 8px);
}

.submenu-group-trigger {
    display: block;
    transition: color 0.18s ease, text-shadow 0.18s ease;
}

.submenu-group-trigger::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-top: 2px solid rgba(214, 230, 243, 0.9);
    border-right: 2px solid rgba(214, 230, 243, 0.9);
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.submenu-secondary {
    min-width: 100%;
    top: -5px;
    left: calc(100% - 6px);
    margin-top: 0;
    z-index: 1001;
    transform-origin: top left;
    transform: translateX(14px) scale(0.97);
}

.submenu-group:hover > .submenu-secondary,
.submenu-group:focus-within > .submenu-secondary {
    transform: translateX(0) scale(1);
}

.submenu-group:hover > .submenu-group-trigger,
.submenu-group:focus-within > .submenu-group-trigger {
    color: #f6d76a;
}

.submenu-group:hover > .submenu-group-trigger::after,
.submenu-group:focus-within > .submenu-group-trigger::after {
    border-color: #f6d76a;
    transform: translateY(-50%) translateX(2px) rotate(45deg);
}

a {
    text-decoration: none; /* Sin subrayado */
    color: inherit; /* Mantiene el color del texto */
}

/* ===== POPUP ESTADISTICAS ===== */

.eci-stats-hover {
    position: relative;
}

/* Panel desplegable */
.eci-stats-pop {
    display: block;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 9999;

    /* Ajuste limpio */
    width: auto;
    height: auto;
    padding: 0;

    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible; /* sin scroll */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(0.97);
    transition:
        opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.28s ease;
}

/* Mostrar al hover */
.eci-stats-hover:hover .eci-stats-pop,
.eci-stats-hover:focus-within .eci-stats-pop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Iframe ajustado SIN scroll */
.eci-stats-iframe {
    display: block;
    width: 260px;
    height: 300px; /* Misma altura actual */
    border: 0;
    overflow: hidden;
    background: transparent;
}

/* Enlace */
.eci-stats-link {
    display: inline-block;
}

/* ===== ACCESO CONTROL ===== */

.eci-access-guard {
    position: relative;
    z-index: 10000;
}

.eci-access-pop {
    position: fixed;
    width: 270px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: top center;
    transform: translateY(18px) scale(0.92);
    transition:
        opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.32s ease;
}

.eci-access-pop::before {
    content: '';
    position: absolute;
    inset: -14px;
}

.eci-access-pop[hidden] {
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.eci-access-guard.is-open .eci-access-pop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.eci-access-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 20px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background:
        linear-gradient(165deg, rgba(30, 52, 75, 0.97), rgba(18, 34, 52, 0.98));
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(100, 160, 220, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    position: relative;
}

.eci-access-form::before {
    content: '';
    display: block;
    width: 36px;
    height: 36px;
    margin: 0 auto 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3a8fd4, #2567a8);
    box-shadow: 0 4px 14px rgba(58, 143, 212, 0.35);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}

.eci-access-label {
    color: #c8ddf0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.3;
}

.eci-access-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(120, 170, 210, 0.35);
    border-radius: 8px;
    background: rgba(240, 248, 255, 0.95);
    color: #17324a;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eci-access-input:focus {
    outline: none;
    border-color: #5ba3d9;
    box-shadow:
        0 0 0 3px rgba(91, 163, 217, 0.25),
        0 2px 8px rgba(91, 163, 217, 0.15);
}

.eci-access-submit {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4a9fd8, #2d72b4);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.eci-access-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #5aafe8, #3580c0);
    box-shadow: 0 8px 22px rgba(53, 131, 191, 0.35);
}

.eci-access-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(53, 131, 191, 0.25);
}

.eci-access-submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.eci-access-feedback {
    min-height: 15px;
    margin: 0;
    color: #90b8d8;
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
}

.eci-access-feedback.is-info {
    color: #a8d4f7;
}

.eci-access-feedback.is-error {
    color: #ff9e9e;
}
