.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.8) 25%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.2) 75%,
        transparent 100%
    );
    padding-bottom: 20px;
    will-change: background-color;
}

.header.scrolled {
    background: rgba(20, 20, 20, 0.98);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    padding-bottom: 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4%;
    height: 70px;
}

/* Logo */
.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.header-logo {
    display: block; 
    padding-right: 0;
    flex-shrink: 0;
    padding-top: 5px; 
    margin-right: 35px; /* Adjusted margin */
}

.header-logo:hover {
    opacity: 0.8;
}

.header-brand {
    display: block;
    height: 35px; 
    width: auto; 
    max-width: none; 
    object-fit: contain;
    /* Scale adjusted to ~60% of previous size (2.1) */
    transform: scale(2.1); 
    transform-origin: center left;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Nav Items with Dropdowns */
.nav-item {
    position: relative;
    padding: 10px 0;
}

/* Specific class for the mobile browse item */
.nav-item.browse-item {
    display: none; 
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: #e5e5e5;
    transition: color 0.2s;
    text-decoration: none;
    cursor: pointer;
}

.nav-link:hover {
    color: #b3b3b3;
}

.nav-link.active {
    font-weight: 700;
    color: #fff;
}

/* Generic Nav Dropdown - Subtle */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background-color: rgba(0, 0, 0, 0.9);
    border-top: 2px solid #fff; 
    border: 1px solid rgba(255,255,255,0.15);
    padding: 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    z-index: 1000;
    margin-top: 15px;
}

.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
}

.nav-item:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown a {
    display: block;
    padding: 10px 15px;
    font-size: 13px;
    color: #b3b3b3;
    transition: background 0.1s;
    background: transparent;
}

.nav-dropdown a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: underline;
}

/* Right Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.125rem;
    background: none;
    border: none;
    cursor: pointer;
}

.search-input {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    padding: 8px 8px 8px 40px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 1px solid #fff;
    color: #fff;
    opacity: 0;
    transition: width 0.3s;
}
.search-input.active { width: 250px; opacity: 1; }

/* Notifications */
.notifications-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.125rem;
    background: none;
    border: none;
    cursor: pointer;
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 1.5rem);
    right: 0;
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 400px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.header-notifications:hover .notifications-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.notification-title { font-weight: bold; font-size: 14px; color: #fff; }
.notification-text { color: #ccc; font-size: 12px; }

/* Profile */
.profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.profile-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}
.profile-arrow {
    transition: transform 0.3s;
    color: #fff;
}
.profile-toggle:hover .profile-arrow { transform: rotate(180deg); }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 1.5rem);
    right: 0;
    background-color: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 200px;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0);
    transition: all 0.2s;
}
.header-profile:hover .profile-dropdown {
    opacity: 1;
    visibility: visible;
}
.profile-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #fff;
    text-decoration: none;
}
.profile-dropdown a:hover { background: rgba(255,255,255,0.1); }
.profile-dropdown hr { border-color: rgba(255,255,255,0.1); }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
}
.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #fff;
}
