/* ========================= */
/* HEADER & NAVIGATION       */
/* ========================= */

.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.header.scrolled {
    background: var(--header-bg);
    backdrop-filter: blur(18px);
    box-shadow: none;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 24px;
    transition: .35s;
}

.logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo span {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: var(--white);
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-weight: 500;
    transition: .3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: .35s;
}

.nav-links a:hover::after {
    width: 100%;
}

.btn-nav {
    padding: clamp(0.625rem, 1vw, 0.875rem) clamp(1.25rem, 2vw, 1.75rem);
    background: var(--primary);
    color: var(--white);
    border-radius: var(--button-radius);
    font-weight: 600;
    transition: var(--transition);
}

.btn-nav:hover {
    transform: translateY(-2px);
    background: var(--secondary);
    box-shadow: var(--shadow-primary-hover);
}

/* --- Theme Toggle Controls --- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--glass-bg);
    color: var(--dark);
    backdrop-filter: blur(10px);
    box-shadow: none;
    transition: var(--transition);
}

.theme-toggle .theme-tab {
    appearance: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: clamp(0.5rem, 0.8vw, 0.625rem) clamp(0.625rem, 1vw, 0.875rem);
    border-radius: 999px;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle .theme-tab:hover {
    color: var(--dark);
}

.theme-toggle .theme-tab.active {
    color: var(--white);
    background: var(--primary);
    box-shadow: var(--shadow-tab-active);
}

.theme-toggle-floating {
    position: fixed;
    right: -30px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    z-index: 1200;
    min-width: 158px;
    box-shadow: none;
    opacity: .96;
}

.theme-toggle-floating:hover {
    opacity: 1;
    transform: translateY(calc(-50% - 2px)) rotate(90deg);
}

.theme-toggle:hover {
    border-color: var(--primary);
}

[data-theme="dark"] .theme-toggle {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

[data-theme="dark"] .theme-toggle .theme-tab {
    color: var(--muted);
}

[data-theme="dark"] .theme-toggle .theme-tab:hover {
    color: var(--dark);
}

[data-theme="dark"] .theme-toggle .theme-tab.active {
    color: var(--white);
    background: var(--primary);
    box-shadow: var(--shadow-tab-active);
}

.menu-btn {
    display: none;
}

@media (max-width: 900px) {
    .navbar {
        height: 80px;
    }

    .menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        width: 45px;
        height: 45px;
        border: none;
        background: none;
        cursor: pointer;
    }

    .menu-btn span {
        width: 26px;
        height: 3px;
        background: var(--dark);
        border-radius: 20px;
        transition: .3s;
    }

    .nav-links {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--panel);
        border-bottom: 1px solid var(--border);
        box-shadow: none;
        flex-direction: column;
        align-items: center;
        gap: 24px;
        padding: clamp(1.75rem, 3vw, 2.5rem) 0;
        transform: translateY(-150%);
        opacity: 0;
        visibility: hidden;
        transition: .35s;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .btn-nav {
        display: none;
    }

    .theme-toggle-floating {
        right: 12px;
        min-width: 156px;
    }
}

@media (max-width: 500px) {
    .theme-toggle-floating {
        top: auto;
        bottom: 16px;
        transform: rotate(90deg);
        transform-origin: right center;
        right: 10px;
        min-width: 150px;
        padding: 5px;
    }

    .theme-toggle-floating:hover {
        transform: translateY(-2px) rotate(90deg);
    }

    .theme-toggle .theme-tab {
        min-width: 72px;
        padding: 10px 14px;
        font-size: 12px;
    }
}
