/* ============================================
   LOHMIA HEADER COMPONENT v1.0
   Navegacion unificada para todas las paginas
   ============================================ */

/* === HEADER PRINCIPAL === */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary, #1e293b);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color, #475569);
}

/* === LOGO SECTION === */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 150px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue, #3b82f6), var(--accent-cyan, #06b6d4));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}

/* === NAVEGACION PRINCIPAL === */
.nav-links {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.nav-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    color: var(--text-secondary, #94a3b8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.nav-btn:hover {
    color: var(--text-primary, #f1f5f9);
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue, #3b82f6);
}

.nav-btn.active {
    color: white;
    background: var(--accent-blue, #3b82f6);
    border-color: var(--accent-blue, #3b82f6);
}

/* Dropdown arrow en nav items */
.nav-btn .dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s;
    margin-left: 0.25rem;
}

.nav-item-with-dropdown:hover .nav-btn .dropdown-arrow {
    transform: rotate(180deg);
}

/* === HEADER ACTIONS (derecha) === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #475569);
    background: var(--bg-primary, #0f172a);
    color: var(--text-primary, #f1f5f9);
    border-radius: 6px;
    font-size: 0.85rem;
    width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    width: 250px;
}

.search-input::placeholder {
    color: var(--text-secondary, #94a3b8);
}

.last-update {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    white-space: nowrap;
}

/* === BOTONES GENERICOS === */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-blue, #3b82f6);
    color: white;
    border-color: var(--accent-blue, #3b82f6);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary, #f1f5f9);
    border-color: var(--border-color, #475569);
}

.btn-secondary:hover {
    background: var(--bg-card, #334155);
    border-color: var(--accent-blue, #3b82f6);
}

/* === HAMBURGER MENU (MOBILE) === */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary, #f1f5f9);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* === MOBILE NAV OVERLAY === */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* === MOBILE NAV DRAWER === */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-secondary, #1e293b);
    z-index: 999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

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

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #475569);
}

.mobile-nav-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue, #3b82f6), var(--accent-cyan, #06b6d4));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.mobile-nav-close:hover {
    color: var(--text-primary, #f1f5f9);
}

/* === MOBILE NAV LINKS === */
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.mobile-nav-links .nav-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
}

.mobile-nav-links .nav-btn .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* === QUICK ACTIONS (Header derecha) === */
.quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.quick-action-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--border-color, #475569);
    color: var(--text-primary, #f1f5f9);
}

.quick-action-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--accent-red, #ef4444);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === USER DROPDOWN === */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color, #475569);
    border-radius: 8px;
    color: var(--text-primary, #f1f5f9);
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue, #3b82f6);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-blue, #3b82f6), var(--accent-purple, #8b5cf6));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-btn .dropdown-arrow {
    font-size: 0.6rem;
    color: var(--text-secondary, #94a3b8);
    transition: transform 0.2s;
}

.user-dropdown:hover .user-btn .dropdown-arrow {
    transform: rotate(180deg);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .header-actions {
        flex: 0 0 300px;
    }

    .search-input {
        width: 180px;
    }

    .search-input:focus {
        width: 200px;
    }
}

@media (max-width: 1024px) {
    .main-header {
        padding: 0.75rem 1.5rem;
    }

    .logo-section {
        flex: 0 0 auto;
    }

    .nav-links {
        gap: 0.25rem;
    }

    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .header-actions {
        flex: 0 0 auto;
    }

    .search-input {
        width: 150px;
    }

    .last-update {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem 1rem;
    }

    .logo-section {
        flex: 1;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .search-input {
        display: none;
    }

    .user-name {
        display: none;
    }

    .quick-actions {
        gap: 0.25rem;
    }

    .quick-action-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0.5rem 0.75rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}
