/* === Variables y Reset === */
:root {
    --azul-oscuro: #1B3A6B;
    --azul-medio: #2a5298;
    --teal: #00A896;
    --teal-hover: #008F80;
    --teal-glow: rgba(0, 168, 150, 0.3);
    --blanco: #FFFFFF;
    --gris-claro: #F5F7FA;
    --gris-texto: #4A5568;
    --gris-borde: #E2E8F0;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--gris-texto);
    background-color: var(--blanco);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* === Animaciones === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--teal-glow); }
    50% { box-shadow: 0 0 20px 8px var(--teal-glow); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* === Header === */
.header {
    background-color: var(--azul-oscuro);
    padding: 0.6rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-logo img {
    height: 32px;
    width: auto;
    transition: transform 0.3s ease;
}

.header-logo img:hover {
    transform: scale(1.05);
}

/* === Navigation Links (Desktop) === */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--blanco);
    background: rgba(255, 255, 255, 0.12);
}

.nav-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.nav-logout {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
}

.nav-logout:hover {
    color: #fc8181;
    background: rgba(252, 129, 129, 0.1);
}

.header-user {
    color: var(--teal);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.6rem;
}

.nav-divider {
    display: none;
}

.nav-user-mobile {
    display: none;
}

/* === Hamburger Button === */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 300;
}

.menu-bar {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--blanco);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.open .menu-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open .menu-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open .menu-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* === Overlay === */
.nav-overlay {
    display: none;
}

/* === Main Content === */
.main-content {
    flex: 1;
    width: 100%;
}

/* === Botones === */
.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--teal), #00c9a7);
    color: var(--blanco);
    box-shadow: 0 4px 15px rgba(0, 168, 150, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(0, 168, 150, 0.45);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--blanco);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
    border-color: var(--teal);
    color: var(--teal);
    transform: translateY(-2px);
}

/* === Tipografía === */
h1, h2, h3, h4 {
    color: var(--azul-oscuro);
    line-height: 1.3;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

/* === Modal / Overlay === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--blanco);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gris-texto);
    transition: color 0.2s;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--azul-oscuro);
}

/* ===========================
   RESPONSIVE — Mobile First
   =========================== */

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; }

    /* Show hamburger */
    .menu-toggle {
        display: flex;
    }

    /* Hide desktop user span */
    .header-user {
        display: none;
    }

    /* Slide-out menu */
    .header-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--azul-oscuro);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 5rem 1.25rem 2rem;
        transition: right 0.3s ease;
        z-index: 250;
        overflow-y: auto;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.3);
    }

    .header-nav.open {
        right: 0;
    }

    /* User info at top of mobile menu */
    .nav-user-mobile {
        display: flex;
        flex-direction: column;
        padding: 0 0.5rem 1.25rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-user-name {
        color: var(--blanco);
        font-weight: 700;
        font-size: 1rem;
    }

    .nav-user-email {
        color: rgba(255, 255, 255, 0.5);
        font-size: 0.75rem;
        margin-top: 0.15rem;
    }

    /* Nav links in mobile */
    .nav-link {
        font-size: 0.95rem;
        padding: 0.85rem 0.75rem;
        border-radius: 10px;
        margin-bottom: 0.15rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .nav-link:hover,
    .nav-link:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-icon {
        font-size: 1.15rem;
        width: 1.5rem;
        text-align: center;
    }

    .nav-divider {
        display: block;
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
        margin: 0.75rem 0.5rem;
    }

    .nav-logout {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.5);
        margin-top: 0.25rem;
    }

    /* Background overlay */
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.open {
        opacity: 1;
        pointer-events: all;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.4rem; }
}
