/* Header styles - Componente reutilizable */


:root {
    --cucu-pink: #fdf2f8;
    --cucu-blue: #bfdbfe;
    --cucu-lavender: #e9d5ff;
    --cucu-cream: #fffbeb;
    --cucu-text: #334155;
    --cucu-text-light: #64748b;
    --white: #ffffff;
    --border-light: #f1f5f9;
    --orange-accent: #fed7aa;
    --orange-hover: #fdba74;
}

/* Header principal */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cucu-pink);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Container para márgenes consistentes */
.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ✅ Logo más grande */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 40px; /* Espacio después del logo */
}

.logo svg {
    color: var(--cucu-blue);
    transition: color 0.2s ease;
    width: 100px; /* ✅ Logo más grande */
    height: 40px;  /* ✅ Logo más grande */
}

.logo:hover svg {
    color: #93c5fd;
}

/* ✅ Navegación posicionada después del logo */
.nav {
    display: flex;
    gap: 24px; /* ✅ Espacio más pequeño entre elementos */
    margin-left: 0; /* Pegado al logo */
    flex: 1; /* Toma el espacio disponible */
}

.nav a {
    text-decoration: none;
    color: var(--cucu-text);
    font-weight: 500;
    font-size: 0.9rem; /* ✅ Texto más pequeño */
    transition: color 0.2s;
    position: relative;
}

.nav a:hover {
    color: #3b82f6;
}

.nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    background-color: var(--cucu-blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav a:hover::after {
    width: 100%;
}

/* ✅ Dropdown Login - CORREGIDO */
.login-dropdown {
    position: relative;
    display: inline-block;
}

.btn-login {
    background: var(--cucu-blue);
    color: var(--cucu-text);
    padding: 8px 24px;
    border: 2px solid var(--cucu-blue);
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    width: 200px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ✅ CLAVE: El dropdown debe estar oculto por defecto */
.dropdown-content {
    display: none !important; /* Forzar que esté oculto inicialmente */
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 320px;
    padding: 32px;
    border: 1px solid rgba(191, 219, 254, 0.3);
    z-index: 1000;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* ✅ CLAVE: Cuando tiene la clase 'show', se muestra */
.dropdown-content.show {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    animation: slideIn 0.3s ease-out;
}

.dropdown-header {
    text-align: center;
    margin-bottom: 24px;
}

.dropdown-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--cucu-text);
    margin-bottom: 8px;
}

.dropdown-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 300;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--cucu-text);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    height: 40px;
    padding: 10px 14px;
    border: 2px solid rgba(191, 219, 254, 0.3);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    color: var(--cucu-text);
}

.form-input:focus {
    outline: none;
    border-color: var(--cucu-blue);
    background: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(191, 219, 254, 0.3);
}

.form-input::placeholder {
    color: #94a3b8;
}

.btn-primary-dropdown {
    width: 100%;
    height: 40px;
    background: linear-gradient(135deg, var(--cucu-blue) 0%, var(--cucu-lavender) 100%);
    color: var(--cucu-text);
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(254, 215, 170, 0.4);
    font-family: 'Poppins', sans-serif;
    margin-bottom: 12px;
}

.btn-primary-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(254, 215, 170, 0.6);
    background: linear-gradient(135deg, var(--cucu-lavender) 0%, #d6beff 100%);
}

.btn-primary-dropdown:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.toggle-text {
    text-align: center;
    margin-top: 16px;
    color: #64748b;
    font-size: 0.85rem;
}

.toggle-link {
    color: var(--orange-hover);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.toggle-link:hover {
    text-decoration: underline;
}

/* Menu de usuario autenticado */
.user-menu {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-user-menu {
    background: var(--cucu-pink);
    color: var(--cucu-text);
    padding: 8px 20px;
    border: 2px solid var(--cucu-pink);
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.btn-user-menu:hover {
    background: var(--cucu-lavender);
    border-color: var(--cucu-lavender);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-logout {
    background: var(--cucu-blue);
    color: var(--cucu-text);
    padding: 8px 20px;
    border: 2px solid var(--cucu-blue);
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: var(--cucu-lavender);
    border-color: var(--cucu-lavender);
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ✅ DEBUGGING - Para poder ver si el dropdown está presente */
.dropdown-content {
    /* Asegurar que esté por encima de todo */
    z-index: 9999 !important;
}

/* ✅ Estados específicos para evitar conflictos */
.dropdown-content:not(.show) {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.dropdown-content.show {
    display: block !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

/* ✅ Responsive mejorado */
@media (min-width: 768px) {
    .nav {
        display: flex;
    }
    
    /* ✅ Layout del header en desktop */
    .header-content {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* Alinear al inicio */
    }
    
    .logo {
        margin-right: 40px;
    }
    
    .nav {
        flex: 0 0 auto; /* No tomar todo el espacio disponible */
        margin-right: auto; /* Empujar el menú de usuario al final */
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .logo {
        margin-right: 20px;
    }
    
    .logo svg {
        width: 80px;
        height: 32px;
    }
    
    .nav {
        order: 3; /* Navegación al final en móvil */
        width: 100%;
        justify-content: center;
        margin-top: 12px;
        gap: 16px;
    }
    
    .nav a {
        font-size: 0.85rem;
    }
    
    .user-menu {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .btn-user-menu,
    .btn-logout {
        padding: 6px 16px;
        font-size: 0.9rem;
        max-width: 120px;
    }
    
    .dropdown-content {
        width: 280px;
        padding: 24px;
        right: -20px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .logo {
        margin-right: 0;
    }
    
    .nav {
        order: 2;
        margin-top: 0;
        width: 100%;
        justify-content: center;
    }
    
    .user-menu {
        order: 3;
        justify-content: center;
        width: 100%;
    }
    
    .btn-user-menu,
    .btn-logout {
        flex: 1;
        max-width: none;
    }
    
    .dropdown-content {
        position: fixed;
        right: 10px;
        left: 10px;
        width: auto;
        margin-top: 0;
    }
}

/* Efectos hover mejorados */
.btn-login,
.btn-user-menu,
.btn-logout {
    position: relative;
    overflow: hidden;
}

.btn-login::before,
.btn-user-menu::before,
.btn-logout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before,
.btn-user-menu:hover::before,
.btn-logout:hover::before {
    left: 100%;
}