/* ============================================
   VITALIX NAVBAR - MODERN CLEAN VERSION
   Diseño claro y profesional para app médica
   Colores: Teal/Cyan (salud y confianza)
   ============================================ */

/* --------------------------------------------
   1. RESET Y BASE
-------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --------------------------------------------
   2. NAVBAR PRINCIPAL
-------------------------------------------- */
.vitalix-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.vitalix-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom-color: transparent;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    gap: 2rem;
}

/* --------------------------------------------
   3. LOGO
-------------------------------------------- */
.nav-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
}

.logo-wrapper {
    position: relative;
}

.logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

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

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-logo a:hover .logo-glow {
    opacity: 1;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: all 0.3s ease;
}

.nav-logo a:hover .logo-text {
    background: linear-gradient(135deg, #0891b2 0%, #0f766e 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* --------------------------------------------
   4. MENÚ DESKTOP
-------------------------------------------- */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link span {
    position: relative;
    z-index: 1;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover {
    color: #0891b2;
}

.nav-link.active {
    color: #0891b2;
}

/* --------------------------------------------
   5. BOTONES DE ACCIÓN
-------------------------------------------- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-login, .btn-dashboard {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Botón Login */
.btn-login {
    background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

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

.btn-login:hover::before {
    width: 200px;
    height: 200px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

.btn-login:active {
    transform: translateY(0);
}

/* Botón Dashboard */
.btn-dashboard {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.btn-dashboard:hover {
    background: #f1f5f9;
    border-color: #0891b2;
    color: #0891b2;
    transform: translateY(-2px);
}

.btn-dashboard:active {
    transform: translateY(0);
}

/* --------------------------------------------
   6. BOTÓN MÓVIL (HAMBURGUESA)
-------------------------------------------- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.hamburger {
    width: 24px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background: #475569;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover .hamburger span {
    background: #0891b2;
}

/* Hamburger animado cuando está activo */
.mobile-menu-btn.active .hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --------------------------------------------
   7. MENÚ MÓVIL
-------------------------------------------- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

/* Header del menú móvil */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #0f172a;
}

.mobile-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.mobile-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f766e, #0891b2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.mobile-close {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-close:hover {
    background: #e2e8f0;
    color: #0891b2;
}

/* Enlaces del menú móvil */
.mobile-menu-links {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.mobile-link-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.mobile-link:hover {
    background: #f8fafc;
    color: #0891b2;
    transform: translateX(5px);
}

.mobile-link.logout-mobile {
    color: #ef4444;
}

.mobile-link.logout-mobile:hover {
    background: #fef2f2;
}

.mobile-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.75rem 0;
}

/* Footer del menú móvil */
.mobile-menu-footer {
    padding: 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mobile-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0f766e, #0891b2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    text-transform: uppercase;
}

.mobile-user-details {
    flex: 1;
}

.mobile-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.mobile-user-email {
    font-size: 0.7rem;
    color: #64748b;
}

/* --------------------------------------------
   8. OVERLAY MÓVIL
-------------------------------------------- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------
   9. RESPONSIVE
-------------------------------------------- */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        height: 60px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
    
    .btn-login span,
    .btn-dashboard span {
        display: none;
    }
    
    .btn-login, .btn-dashboard {
        padding: 8px;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
    
    .btn-login svg,
    .btn-dashboard svg {
        margin: 0;
    }
    
    .logo-img {
        width: 28px;
        height: 28px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .logo-img {
        width: 24px;
        height: 24px;
    }
}

/* --------------------------------------------
   10. SCROLL COMPORTAMIENTO
-------------------------------------------- */
.vitalix-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------
   11. HOVER (Solo dispositivos con hover)
-------------------------------------------- */
@media (hover: hover) {
    .nav-link:hover {
        color: #0891b2;
    }
    
    .btn-login:hover {
        transform: translateY(-2px);
    }
    
    .btn-dashboard:hover {
        transform: translateY(-2px);
    }
}

/* --------------------------------------------
   12. TOUCH FEEDBACK
-------------------------------------------- */
.btn-login,
.btn-dashboard,
.mobile-menu-btn,
.mobile-link,
.mobile-close {
    -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------
   13. REDUCCIÓN DE MOVIMIENTO
-------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .vitalix-navbar,
    .nav-link::before,
    .btn-login,
    .btn-dashboard,
    .mobile-menu,
    .mobile-link,
    .btn-login::before {
        transition: none !important;
        animation: none !important;
    }
}