/* Header styles for Climate Data Explorer */

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-logo {
    height: 2rem;
    width: auto;
    margin-right: 0.25rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.nav-link.active {
    color: var(--primary-600);
    background: var(--primary-50);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Header search bar - smaller and more compact */
.header .search-container {
    position: relative;
    z-index: 1001;
    width: 240px;
    flex-shrink: 0;
}

.header .search-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: white;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.header .search-input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

.header .search-input::placeholder {
    color: var(--gray-400);
}

.header .search-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    font-size: 0.8rem;
}

.header .search-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    box-shadow: var(--shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.highlighted {
    background: var(--primary-50);
}

.city-name {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.city-details {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Mobile menu button - hidden by default */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    position: relative;
    z-index: 1002;
}

.mobile-menu-btn:hover {
    background-color: var(--gray-100);
}

.mobile-menu-btn.active {
    background-color: var(--primary-50);
}

.hamburger-line {
    width: 1.25rem;
    height: 2px;
    background-color: var(--gray-700);
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile navigation dropdown - hidden by default */
.mobile-nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    margin-top: 0.5rem;
    overflow: hidden;
}

.mobile-nav-dropdown.show {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    padding: 1rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s ease;
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link:hover {
    background-color: var(--gray-50);
    color: var(--primary-600);
}

.mobile-nav-link.active {
    background-color: var(--primary-50);
    color: var(--primary-600);
    font-weight: 600;
}

/* Responsive styles */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
        position: relative;
    }
    
    .header-content {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;
    }
    
    .header-left {
        gap: 0.75rem;
    }
    
    .header-actions {
        flex-direction: row;
        gap: 1rem;
        width: auto;
        align-items: center;
        position: relative;
    }
    
    /* Show mobile menu button, hide desktop nav */
    .mobile-menu-btn {
        display: flex;
        order: 1;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .header .search-container {
        width: 180px;
        order: 2;
    }
    
    .site-logo {
        height: 1.25rem;
        margin-right: 0.5rem;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-content {
        gap: 0.75rem;
    }
    
    .header-left {
        gap: 0.5rem;
    }
    
    .header-actions {
        gap: 0.75rem;
    }
    
    .header .search-container {
        width: 140px;
    }
    
    .header .search-input {
        padding: 0.375rem 1.5rem 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .header .search-input::placeholder {
        font-size: 0.75rem;
    }
    
    .header .search-icon {
        right: 0.375rem;
        font-size: 0.75rem;
    }
    
    .mobile-menu-btn {
        width: 2rem;
        height: 2rem;
        padding: 0.375rem;
    }
    
    .hamburger-line {
        width: 1rem;
        height: 1.5px;
        margin: 1.5px 0;
    }
    
    .site-logo {
        height: 1rem;
        margin-right: 0.375rem;
    }
    
    .site-title {
        font-size: 1.125rem;
    }
    
    .mobile-nav-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}