/* Header */
.main-header {
    background-color: rgba(3, 7, 18, 0.8); /* var(--bg-dark) with opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

[data-theme="light"] .main-header {
    background-color: rgba(226, 232, 240, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.navbar .nav-menu {
    margin-left: auto;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 700;
}

.logo img {
    height: 32px;
    width: auto;
}

[data-theme="light"] .logo img {
    filter: brightness(0);
}

/* Navigation */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Enlaces solo para móvil (ocultos en desktop) */
.mobile-only {
    display: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    list-style: none;
    min-width: 200px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

[data-theme="light"] .dropdown-menu li a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    margin: 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 1;
}

.theme-toggle:hover {
    color: var(--text-main);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

/* Header Actions (theme toggle + hamburger) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1rem;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .logo img {
        height: 24px;
        flex-shrink: 0;
    }
    
    .hamburger {
        display: flex;
        flex-shrink: 0;
    }
    
    .header-actions {
        order: 3;
        flex-shrink: 0;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        bottom: auto;
        background-color: var(--bg-dark);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0.5rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        align-items: flex-start;
        box-shadow: var(--shadow-lg);
        min-width: 180px;
    }
    
    /* Transiciones solo cuando hay interacción */
    .nav-menu.can-transition {
        transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    }
    
    [data-theme="light"] .nav-menu {
        background-color: var(--bg-card);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-link {
        padding: 0.5rem 0;
        width: 100%;
    }
    
    /* Ocultar dropdown completo en móvil */
    .dropdown {
        display: none;
    }
    
    /* Mostrar enlaces móvil */
    .mobile-only {
        display: block;
    }
}
