/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    height: 100vh; /* Altura completa del viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* No scroll en body */
}

/* Header PRINCIPAL solamente */
#header {
    background: rgba(199, 234, 254, 1);
    color: #333;
    height: 10vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Logo - 30% del espacio */
.nav-logo {
    flex: 0 0 30%;
    display: flex;
    align-items: center;
    height: 100%;
}

.logo-image {
    height: 50px;
    width: auto;
    max-height: 60px;
    object-fit: contain;
}

/* Menú - 70% del espacio, alineado a la derecha */
.nav-menu {
    flex: 0 0 70%;
    display: flex;
    list-style: none;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    height: 100%;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    color: rgba(11, 89, 161, 1) !important;
    text-decoration: none;
    font-weight: bold !important;
    transition: all 0.3s ease;
    padding: 0 1.5rem;
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    transform: scale(1);
    transform-origin: center;
}

.nav-link:hover {
    background-color: rgba(129, 0, 64, 0.15);
    color: #810040 !important;
    transform: scale(1.1);
}

.nav-link.active {
    background-color: rgba(129, 0, 64, 0.2);
    color: #810040 !important;
    transform: scale(1.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #810040;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Main Content - CORRECCIÓN DEFINITIVA */
#main {
    flex: 1;
    margin-top: 10vh; /* Espacio para header */
    margin-bottom: 15vh; /* Espacio para footer */
    overflow-y: auto; /* SCROLL VERTICAL */
    height: 75vh; /* Altura fija */
    position: relative;
}

/* Contenedor del contenido */
.page-content {
    min-height: 100%; /* Ocupa todo el espacio disponible */
}

/* Estilos para el contenido cargado */
.content-loaded {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    /* SIN altura mínima - el contenido define la altura */
}

/* Reset para headers dentro del contenido */
.content-loaded header {
    position: static !important;
    height: auto !important;
    background: transparent !important;
    color: #333 !important;
    box-shadow: none !important;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 3px solid #c7eafe;
    padding-bottom: 1rem;
}

.content-loaded h1 {
    color: #810040;
    font-size: 2.5rem;
    margin-bottom: 0;
}

.content-loaded p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 75vh; /* Altura mínima igual al main */
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    background: white;
    color: #f5576c;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
}

/* Footer */
#footer {
    background: rgba(129, 0, 64, 1);
    color: white;
    height: 15vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    cursor: pointer;
}

.footer-section a:hover {
    color: #c7eafe;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.footer-bottom {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid rgba(199, 234, 254, 0.3);
    background: rgba(102, 0, 51, 1);
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem;
    font-size: 1.2rem;
    color: #666;
}

/* Estilos para tablas */
.content-loaded table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
}

.content-loaded thead {
    background: linear-gradient(135deg, #0b59a1 0%, #1a6bb8 100%);
}

.content-loaded thead th {
    color: white;
    font-weight: bold;
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #0b59a1;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-loaded tbody tr {
    transition: all 0.3s ease;
}

.content-loaded tbody tr:nth-child(odd) {
    background-color: #e8f4fd;
}

.content-loaded tbody tr:nth-child(even) {
    background-color: #d4eafb;
}

.content-loaded tbody tr:hover {
    background-color: #b8dff9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(11, 89, 161, 0.2);
}

.content-loaded tbody td,
.content-loaded tbody th {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #c7eafe;
    color: #333;
}

.content-loaded tbody th {
    font-weight: 600;
    color: #0b59a1;
    background-color: #e8f4fd;
    border-right: 2px solid #c7eafe;
}

.content-loaded td:first-child,
.content-loaded th:first-child {
    padding-left: 1.5rem;
}

.content-loaded td:last-child,
.content-loaded th:last-child {
    padding-right: 1.5rem;
}

.content-loaded td.number {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.content-loaded td.currency {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2e7d32;
}

.content-loaded td.percentage {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #d32f2f;
}

.content-loaded td.center {
    text-align: center;
}

.content-loaded tr.highlight {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.content-loaded tr.important {
    background-color: #f8d7da !important;
    border-left: 4px solid #dc3545;
}

.content-loaded tr.success {
    background-color: #d1edff !important;
    border-left: 4px solid #0b59a1;
}

/* Responsive Design */
@media (max-width: 768px) {
    #header {
        height: 8vh;
    }
    
    #main {
        margin-top: 8vh;
        margin-bottom: 15vh;
        height: 77vh;
    }
    
    .hero-section {
        min-height: 77vh;
    }
    
    #footer {
        height: 15vh;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 8vh;
        flex-direction: column;
        background-color: rgba(199, 234, 254, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 0;
        gap: 0;
        justify-content: flex-start;
        height: auto;
    }
    
    .nav-item {
        height: 60px;
        border-bottom: 1px solid rgba(129, 0, 64, 0.1);
    }
    
    .nav-link {
        height: 100%;
        width: 100%;
        justify-content: center;
        padding: 0 2rem;
        transform: scale(1) !important;
    }
    
    .nav-link:hover,
    .nav-link.active {
        transform: scale(1) !important;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link:hover {
        background-color: rgba(129, 0, 64, 0.2);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .content-loaded h1 {
        font-size: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .nav-logo {
        flex: 1;
    }
    
    .nav-menu {
        flex: 0;
    }
}

@media (max-width: 480px) {
    #header {
        height: 7vh;
    }
    
    #main {
        margin-top: 7vh;
        margin-bottom: 15vh;
        height: 78vh;
    }
    
    .hero-section {
        min-height: 78vh;
        padding: 2rem 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .content-loaded {
        padding: 1rem;
    }
    
    .content-loaded h1 {
        font-size: 1.8rem;
    }
    
    #footer {
        height: 15vh;
    }
    
    .nav-menu {
        top: 7vh;
    }
    
    .nav-item {
        height: 55px;
    }
    
    .logo-image {
        height: 35px;
    }
}

/* Scrollbar personalizado PARA EL MAIN */
#main::-webkit-scrollbar {
    width: 12px;
}

#main::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

#main::-webkit-scrollbar-thumb {
    background: #0b59a1;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

#main::-webkit-scrollbar-thumb:hover {
    background: #094580;
}

/* Asegurar que el main tenga scroll cuando el contenido es largo */
#main {
    flex: 1;
    margin-top: 10vh;
    margin-bottom: 15vh;
    overflow-y: auto;
    height: 75vh;
    position: relative;
}

/* Forzar que el contenido ocupe espacio */
.page-content {
    min-height: 100%;
}

.content-loaded {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    /* El contenido define su propia altura */
}

/* Carrusel para el footer en móviles */
@media (max-width: 768px) {
    #footer {
        height: 15vh; /* Mantener altura original */
        position: fixed;
        overflow: hidden; /* Ocultar contenido que se sale */
    }
    
    .footer-content {
        position: relative;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .footer-section {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.5s ease-in-out;
        pointer-events: none;
    }
    
    .footer-section.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }
    
    /* CORRECCIÓN: La sección de derechos ahora es igual a las otras */
    .footer-bottom {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 1rem;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.5s ease-in-out;
        pointer-events: none;
        background: transparent !important; /* Eliminar fondo oscuro */
        border-top: none !important; /* Eliminar borde superior */
    }
    
    .footer-bottom.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: all;
    }
    
    .footer-bottom p {
        color: white !important; /* Mantener texto blanco */
        margin: 0;
        font-size: 1rem;
    }
    
    /* Indicadores del carrusel */
    .footer-indicators {
        position: absolute;
        bottom: 5px;
        left: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 8px;
        z-index: 10;
    }
    
    .footer-indicator {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.5);
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .footer-indicator.active {
        background-color: white;
        transform: scale(1.2);
    }
}

/* Ajustes para móviles muy pequeños */
@media (max-width: 480px) {
    .footer-section h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }
    
    .social-links {
        gap: 0.8rem;
    }
    
    .footer-bottom p {
        font-size: 0.9rem;
    }
    
    .footer-indicator {
        width: 5px;
        height: 5px;
    }
}

/* ESTILOS PARA ESCRITORIO - Footer normal */
@media (min-width: 769px) {
    .footer-bottom {
        background: rgba(102, 0, 51, 1);
        color: white;
    }
    
    .footer-bottom p {
        color: white;
        margin: 0;
    }
    
    .footer-indicators {
        display: none;
    }
}