.header {
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

[data-theme="light"] .header {
    background-color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .header {
    background-color: rgba(15, 15, 30, 0.95);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a {
    text-decoration: none;
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-speed);
    position: relative;
}

.nav-link:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width var(--transition-speed);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    position: relative;
}

.dropdown-toggle::before {
    content: '\f107';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 7 Free';
    font-weight: 900;
    font-size: 0.75rem;
    margin: 0;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    list-style: none;
    min-width: 200px;
    margin-top: 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 8px;
    transform-origin: top right;
    animation: dropdownFadeIn 0.2s ease forwards;
}

[data-theme="light"] .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.05);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-menu.show {
    display: block;
}



.dropdown-link {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 2px;
    border-bottom: none;
}

.dropdown-link:last-child {
    margin-bottom: 0;
}

.dropdown-link:hover {
    background-color: var(--primary-color);
    color: #fff;
    padding-left: 16px;
    /* Reset padding shift preferred by user? keeping simple hover is often cleaner but I will stick to simple bg change */
    transform: translateX(4px);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed);
    color: var(--text-primary);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .theme-toggle #lightIcon {
    display: block;
}

[data-theme="dark"] .theme-toggle #darkIcon {
    display: none;
}

[data-theme="light"] .theme-toggle #lightIcon {
    display: none;
}

[data-theme="light"] .theme-toggle #darkIcon {
    display: block;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--bg-card);
        gap: 0;
        border-top: 1px solid var(--border-color);
        padding: 0;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-list li {
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .nav-list a,
    .nav-list .nav-link {
        display: block;
        padding: 1rem;
        text-align: center;
    }

    .nav-link:not(.dropdown-toggle)::after {
        display: none;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: var(--bg-dark);
    }

    .theme-toggle {
        margin: 1rem auto;
    }

    .menu-toggle {
        display: flex;
    }
}