/* --- Navigation Bar --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--nav-bg-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

nav.scrolled {
    height: 70px;
    background: rgba(15, 15, 26, 0.95);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-brand {
    font-weight: 800;
    font-size: 2em;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 0.3s ease;
}

.nav-brand:hover {
    transform: scale(1.02);
}

.nav-center {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 0 40px;
    max-width: 600px;
}

.search-container {
    position: relative;
    width: 100%;
}

#searchInput {
    width: 100%;
    padding: 12px 24px 12px 48px;
    border-radius: 14px;
    font-size: 0.95em;
    background-color: var(--input-bg-color);
    border: 1px solid transparent;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#searchInput:focus {
    border-color: var(--accent-color);
    background-color: var(--card-bg-color);
    box-shadow: 0 0 0 4px rgba(140, 82, 255, 0.15);
    transform: translateY(-1px);
}

.search-container .fa-search {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color-muted);
    font-size: 0.9em;
    transition: color 0.3s ease;
}

#searchInput:focus+.fa-search {
    color: var(--accent-color);
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    color: var(--text-color-muted);
    font-weight: 600;
    font-size: 0.95em;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: var(--accent-color);
    background: rgba(140, 82, 255, 0.08);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-color);
}

.login-button {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover-color));
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(140, 82, 255, 0.3);
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(140, 82, 255, 0.4);
}

/* Profiles */
.profile-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-hover-color));
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(140, 82, 255, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-icon:hover {
    transform: scale(1.05);
}

.nav-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--input-bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.nav-icon-btn:hover {
    background: var(--card-bg-color);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(140, 82, 255, 0.15);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: var(--modal-bg-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--shadow-color);
    width: 220px;
    overflow: hidden;
    display: none;
    z-index: 1001;
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.profile-dropdown.active {
    display: block;
}

.profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-color);
    font-size: 0.9em;
    font-weight: 500;
    transition: background 0.2s ease;
}

.profile-dropdown a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}

@media (max-width: 1024px) {
    nav {
        padding: 0 30px;
    }

    .nav-center {
        display: none;
        /* Hide search on medium screens, move to menu? */
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Mobile menu needed */
    }
}