/* ============================================
   HEADER & NAVIGATION - ELISAY CODE
   Estilos para el encabezado y menú de navegación
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-fixed);
    transition: var(--transition-normal);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header.sticky {
    padding: 1.5rem 9%;
    background: rgba(10, 14, 39, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* ========== Logo con Imagen + Texto Animado ========== */
.logo {
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    position: relative;
}

.logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: var(--transition-normal);
    filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.3));
    border-radius: 50%;
    animation: logoFloat 3s ease-in-out infinite;
}

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

/* ========== Texto del Logo con Animaciones ========== */
/* ========== Texto del Logo con Animaciones ========== */
.logo-text {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Espacio entre "Elisay" y "Code" */
    font-size: 2.8rem;
    font-weight: 700;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: letterAppear 0.8s ease forwards;
    transition: all 0.3s ease;
}

/* RETRASOS CORRECTOS POR ORDEN (nth-child) */
.logo-text .letter:nth-child(1)  { animation-delay: 0.1s; } /* E1 */
.logo-text .letter:nth-child(2)  { animation-delay: 0.2s; } /* L */
.logo-text .letter:nth-child(3)  { animation-delay: 0.3s; } /* I */
.logo-text .letter:nth-child(4)  { animation-delay: 0.4s; } /* S */
.logo-text .letter:nth-child(5)  { animation-delay: 0.5s; } /* A */
.logo-text .letter:nth-child(6)  { animation-delay: 0.6s; } /* Y */
.logo-text .letter:nth-child(7)  { animation-delay: 0.8s; } /* C */
.logo-text .letter:nth-child(8)  { animation-delay: 0.9s; } /* O */
.logo-text .letter:nth-child(9)  { animation-delay: 1.0s; } /* D */
.logo-text .letter:nth-child(10) { animation-delay: 1.1s; } /* E2 */

@keyframes letterAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== COLORES Y EFECTOS POR LETRA ========== */

/* E1 - Primera E con glow */
.letter[data-letter="E1"] {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    animation: glowPulse 2s ease-in-out infinite alternate;
}

/* E2 - Última E */
.letter[data-letter="E2"] {
    color: #feca57;
    text-shadow: 0 0 8px rgba(254, 202, 87, 0.4);
}

/* Resto */
.letter[data-letter="L"] { color: #00ff88; }
.letter[data-letter="I"] { color: #ff6b6b; }
.letter[data-letter="S"] { color: #ffd93d; }
.letter[data-letter="A"] { color: #a55eea; }
.letter[data-letter="Y"] { color: #ff9f43; }
.letter[data-letter="C"] { color: #4ecdc4; }
.letter[data-letter="O"] { color: #45b7d1; }
.letter[data-letter="D"] { color: #96ceb4; }

/* Iconos */
.letter[data-letter="I"] i,
.letter[data-letter="O"] i {
    font-size: 0.8em;
    vertical-align: middle;
    margin-left: 2px;
    animation: iconBounce 2s ease-in-out infinite;
}

.letter[data-letter="I"] i  { color: #ff6b6b; text-shadow: 0 0 5px rgba(255, 107, 107, 0.6); }
.letter[data-letter="O"] i  { color: #45b7d1; text-shadow: 0 0 5px rgba(69, 183, 209, 0.6); }

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

@keyframes glowPulse {
    from { text-shadow: 0 0 10px rgba(0, 212, 255, 0.5); }
    to { text-shadow: 0 0 20px rgba(0, 212, 255, 0.8), 0 0 30px rgba(0, 212, 255, 0.4); }
}

/* Hover */
.logo:hover .letter {
    transform: scale(1.1);
    animation: letterShake 0.5s ease-in-out;
}

@keyframes letterShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.logo:hover .letter[data-letter="E1"] {
    color: #00b8e6;
    text-shadow: 0 0 25px rgba(0, 184, 230, 1);
}

/* ========== Navigation ========== */
.navbar {
    display: flex;
    gap: 2rem;
}

.navbar a {
    font-size: 1.7rem;
    color: var(--text-color);
    margin-left: 2rem;
    font-weight: var(--font-weight-medium);
    transition: var(--transition-normal);
    position: relative;
    padding: 0.5rem 0;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--main-color);
    transition: var(--transition-normal);
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100%;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

/* ========== Menu Icon (Mobile) ========== */
#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);
    display: none;
    cursor: pointer;
    transition: var(--transition-normal);
}

#menu-icon:hover {
    color: var(--main-color);
    transform: rotate(90deg);
}

/* ========== Responsive Header ========== */
@media (max-width: 992px) {
    .header {
        padding: 2rem 5%;
    }

    .navbar {
        gap: 1.5rem;
    }

    .navbar a {
        font-size: 1.6rem;
        margin-left: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 2rem 3%;
    }
    
    #menu-icon {
        display: block;
    }
    
    .navbar {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem 3%;
        background: rgba(10, 14, 39, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 2px solid rgba(0, 217, 255, 0.2);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        display: none;
        flex-direction: column;
        gap: 0;
    }
    
    .navbar.active {
        display: flex;
    }
    
    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 0;
        padding: 1.5rem;
        border-radius: var(--radius-sm);
        transition: var(--transition-normal);
    }
    
    .navbar a::after {
        display: none;
    }
    
    .navbar a:hover,
    .navbar a.active {
        background: rgba(0, 217, 255, 0.1);
        color: var(--main-color);
    }

    /* Logo en móvil */
    .logo {
        gap: 0.8rem;
    }

    .logo img {
        width: 50px;
        height: 50px;
    }

    .logo-text {
        font-size: 1.4rem;
    }

    .letter {
        font-size: 1.2rem;
    }

    .letter i {
        font-size: 0.7em;
    }
}

@media (max-width: 450px) {
    .logo {
        gap: 0.6rem;
    }

    .logo img {
        width: 45px;
        height: 45px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .letter {
        font-size: 1rem;
    }
}

/* Pantallas muy pequeñas - solo texto */
@media (max-width: 350px) {
    .logo img {
        display: none;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .letter {
        font-size: 1.1rem;
    }
}