/* Modern Premium Navbar - Inspired by Apple & Stripe */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(15, 15, 15, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Light mode navbar */
body:not(.dark-theme) .navbar {
    background: rgba(255, 255, 255, 0);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar-scrolled {
    background: rgba(15, 15, 15, 0.85);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

/* Light mode scrolled navbar */
body:not(.dark-theme) .navbar-scrolled {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.navbar-logo {
    font-size: 2rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 2;
    letter-spacing: -0.02em;
}

.navbar-menu {
    display: flex;
    padding: 0;
    margin: 0;
    list-style-type: none;
}

.navbar-item {
    position: relative;
}

.navbar-link {
    display: block;
    padding: 10px 18px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50px;
    position: relative;
    z-index: 1;
    margin: 0 5px;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.navbar-link:hover {
    color: #fff;
    transform: translateY(-1px);
}

/* Light mode navbar links */
body:not(.dark-theme) .navbar-link {
    color: var(--dark-color);
}

body:not(.dark-theme) .navbar-link:hover {
    color: #fff;
}

.navbar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 50px;
    z-index: -1;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar-link.active {
    color: white;
}

.navbar-link.active::before {
    opacity: 1;
    transform: scale(1);
}

.navbar-link:hover::before {
    opacity: 1;
    transform: scale(1);
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.navbar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background: var(--primary-gradient);
}

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

.navbar-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background: var(--primary-gradient);
}

/* Light mode navbar text color fixes */
body:not(.dark-theme) .navbar-logo {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body:not(.dark-theme) .navbar-toggle span {
    background: var(--dark-color);
}

/* Responsive styles */
@media screen and (max-width: 800px) {
    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 25px;
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    body:not(.dark-theme) .navbar-menu {
        background: rgba(255, 255, 255, 0.95);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.08);
        border-left: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .navbar-menu.active {
        right: 0;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-link {
        font-size: 1.1rem;
        padding: 12px 25px;
    }
}

/* Gradient indicator for active link */
.navbar-indicator {
    position: absolute;
    height: 3px;
    bottom: -5px;
    left: 0;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme Toggle Button */
/* Theme Switch Styles */
.theme-switch-wrapper {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    margin-top: 25px;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.dark-theme) .theme-switch-wrapper {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-switch-wrapper span {
    margin-right: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body:not(.dark-theme) .theme-switch-wrapper span {
    color: var(--text-color);
    text-shadow: none;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: var(--primary-gradient);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(30px);
    background-color: white;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.mobile-only {
    display: none;
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.dark-theme) .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-toggle i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
    color: #ffffff; /* White icon for dark mode */
}

@media screen and (max-width: 800px) {
    .navbar-container {
        padding: 15px 0;
    }
    
    .theme-switch-wrapper {
        display: flex;
        margin-bottom: 10px;
    }
    
    .mobile-only {
        display: block;
    }
    
    #desktopThemeToggle {
        display: none;
    }
    
    .navbar-menu .navbar-link {
        width: 100%;
        text-align: center;
    }
    
    .theme-switch-wrapper span {
        font-size: 0.9rem;
    }
}

body:not(.dark-theme) .theme-toggle i {
    color: #000000; /* Black icon for light mode */
}

body.dark-theme .theme-toggle i {
    color: #ffffff; /* White icon for dark mode */
}
