/* --- Navbar --- */
/* Base navbar style */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 95%;
    margin: 0 auto;
    transition: all 0.3s ease;
    border-radius: 15px;
}

/* Transparent + minimal when at top */
.navbar:not(.scrolled) {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* When scrolled, add modern rounded card look */
.navbar.scrolled {
    background: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    top: 1rem;
    width: 95%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 1.4rem;
}

.nav-links a {
    margin: 0 16px;
    text-decoration: none;
    color: #757171;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #ffffff;
}

.nav-links.light a:hover {
    color: #010101;
}

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

.signin {
    text-decoration: none;
    color: #444;
}

.btn {
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.btn.dark {
    background-color: #111;
}


/* --- Theme Toggle Button --- */

.theme-btn {
    background: rgb(23, 23, 23);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    box-shadow: #222 0px 0px 8px;
}

.dark .theme-btn {
    background-color: #fff;
}

.dark .theme-btn:hover {
    box-shadow: #9ed7f1 0px 0px 8px;
}


/* Mobile theme button hidden by default (desktop layout) */
.mobile-theme-btn {
    background: rgb(23, 23, 23);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}


/* --- Responsive Navbar --- */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    width: 25px;
    height: 20px;
}

.burger span {
    width: 100%;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Animate burger to “X” when active */
.burger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* --- Responsive Navbar Fix --- */
@media (max-width: 1100px) {
    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .burger {
        display: flex;
        margin-left: auto; /* keep burger on far right */
    }

    .nav-links {
        position: absolute;
        top: 70px;
        right: 20px;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
        gap: 10px;
        transition: all 0.3s ease;
        display: none;
    }

    .nav-links.show {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-links a {
        color: var(--text-color);
        font-weight: 600;
    }

    .mobile-theme-btn {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 36px;
        height: 36px;
    }

    .nav-right {
        display: none; /* hide buttons on mobile */
    }

    /* fix logo wrapping */
    .logo {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* ultra-small devices (like phones under 800px) */
@media (max-width: 800px) {
    .navbar {
        width: 100%;
        padding: 0 10px;
    }

    .nav-container {
        padding: 12px 16px;
        flex-direction: row;
    }

    .nav-links {
        right: 10px;
    }
}


/* Optional: smooth transitions */
.nav-links a,
.theme-btn {
    transition: color 0.3s ease, background 0.3s ease;
}