/* Header layout - Tema oscuro moderno con glassmorphism */
.header {
    width: 100%;
    background: rgba(15, 23, 41, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #f8fafc;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 40px rgba(167, 139, 250, 0.1);
    border-bottom: 1px solid rgba(167, 139, 250, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-top: 0;
}

/* Mobile/Desktop visibility helpers */
.mobile-first-row,
.mobile-welcome,
.mobile-only {
    display: none;
}

.desktop-only {
    display: inline;
}

/* Ajuste específico para la página de entrenamiento */
.page-entrenamiento .header {
    margin-top: 0px;
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 15px rgba(167, 139, 250, 0.4));
}

.logo:hover {
    filter: drop-shadow(0 0 25px rgba(192, 132, 252, 0.6));
    transform: translateY(-2px);
}

.logo-img {
    height: clamp(45px, 6vh, 55px);
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.header-user,
.header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-size: clamp(0.825rem, 1.5vw, 0.875rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.user-name strong {
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logout-form {
    margin: 0;
}

/* Pill buttons - Tema moderno */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: clamp(0.8rem, 1.5vw, 0.85rem);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-width: clamp(100px, 15vw, 120px);
    white-space: nowrap;
}

.btn-pill:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.login-btn {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.3) 0%, rgba(192, 132, 252, 0.3) 100%);
    border: 1px solid rgba(167, 139, 250, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(167, 139, 250, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.4) 0%, rgba(192, 132, 252, 0.4) 100%);
    box-shadow: 0 6px 24px rgba(167, 139, 250, 0.4);
    border-color: rgba(167, 139, 250, 0.7);
}

.admin-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.3) 100%);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.admin-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(37, 99, 235, 0.4) 100%);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.7);
}

.logout-btn {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.3) 0%, rgba(239, 68, 68, 0.3) 100%);
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.4) 0%, rgba(239, 68, 68, 0.4) 100%);
    box-shadow: 0 6px 24px rgba(248, 113, 113, 0.4);
    border-color: rgba(248, 113, 113, 0.7);
}

/* Language selector */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(0.8rem, 1.5vw, 0.85rem);
}

.language-switcher label {
    font-weight: 500;
}

.language-switcher select {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 10px;
    padding: 0.4rem 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-switcher select:hover,
.language-switcher select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.language-switcher select option {
    background: #1e293b;
    color: #ffffff;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .header-inner {
        padding: 0.5rem 1.25rem;
    }
}

/* Responsive - Small Tablet */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.4rem 1rem;
    }

    .logo {
        margin-right: auto;
    }

    .header-nav {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 560px) {
    .header-inner {
        padding: 0.4rem 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Primera fila: Logo + Bienvenido */
    .mobile-first-row {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .mobile-first-row .logo {
        margin: 0;
    }

    .mobile-first-row .logo-img {
        height: clamp(40px, 6vh, 50px) !important;
        max-width: 160px !important;
    }

    .mobile-welcome {
        display: inline !important;
        font-size: clamp(0.7rem, 1.5vw, 0.75rem);
        color: #f8fafc;
        text-align: right;
        white-space: nowrap;
    }

    .mobile-welcome strong {
        color: #38bdf8;
    }

    /* Segunda fila: Botones + Selector */
    .header-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-left: 0;
        gap: 0.4rem;
    }

    .header-user,
    .header-auth {
        display: flex;
        gap: 0.4rem;
        flex-wrap: nowrap;
    }

    .language-switcher {
        margin-left: auto;
    }

    .language-switcher label {
        display: none;
    }

    /* Ocultar elementos desktop */
    .desktop-only {
        display: none !important;
    }

    .user-name.desktop-only {
        display: none !important;
    }
}