:root {
    --primary-color: #5624d0;
    --secondary-color: #f5f5f5;
    --dark-color: #1c1d1f;
    --light-color: #fff;
    --border-color: #d1d7dc;
    --text-color: #2d2f31;
    --hover-color: #401b9c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.divnav {
    color: var(--text-color);
    background-color:transparent;
}

/* Login/Signup Buttons */
.login-btn {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    text-decoration: none;
    padding: 8px;
}

.signup-btn {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 600 !important;
    text-decoration: none;
}

.logout-btn {
    background-color: var(--dark-color);
    color: white !important;
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 600 !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

/* Mobile view buttons */
.mobile-nav-links .login-btn {
    color: var(--primary-color) !important;
    display: block;
    padding: 10px 0;
}

.mobile-nav-links .signup-btn {
    background-color: var(--primary-color);
    color: white !important;
    display: inline-block;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 5px;
}

.mobile-nav-links .logout-btn {
    width: 100%;
    text-align: left;
    margin-top: 10px;
}


/* Header Styles */
#header {
    background-color: var(--light-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: fixed; /* Changed to fixed */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: all 0.3s ease;
}

#header.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Navigation Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem; /* Reduced padding for fixed nav */
    max-width: 1440px;
    margin: 0 auto;
    height: 70px; /* Fixed height */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
}
.logo-img {
    height: 50px; /* Adjust as needed */
    margin-right: 10px;
}
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.logo-main {
    font-size: 1.2rem;
    font-weight: 700;
}
.logo-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--dark-color);
    letter-spacing: 0.5px;
}


.nav-containers {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 0;
}

.nav-links a,
.dropdown-btn {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    padding: 1rem;
    display: block;
}

.nav-links a:hover,
.dropdown-btn:hover {
    color: var(--primary-color);
}

.dropdown-icon {
    font-size: 0.8em;
    margin-left: 2px;
}

/* Dropdown */
.dropdown {
    position: relative;
}
.dropdown-btn {
    cursor: pointer;
}
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--light-color);
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 101;
    overflow: hidden;
}
.dropdown:hover .dropdown-content {
    display: block;
}
.dropdown-content a {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}
.dropdown-content a:hover {
    background-color: #f0f0f0;
}


.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Added gap */
}


/* Mobile Navigation */
.mobile-nav-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: var(--light-color);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    padding: 1rem;
    overflow-y: auto;
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: flex-end; /* Changed */
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
#closeMobileNav {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-links {
    list-style: none;
}

.mobile-nav-links li {
    margin-bottom: 0.5rem; /* Reduced margin */
}

.mobile-nav-links a,
.mobile-nav-links summary {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    display: block;
    padding: 0.75rem 0; /* Adjusted padding */
    cursor: pointer;
}
.mobile-nav-links details ul {
    list-style: none;
    padding-left: 1rem;
}
.mobile-nav-links details ul a {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #555;
}


.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Auth Modal Styles */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    display: none; /* Changed to none */
    justify-content: center;
    align-items: center;
}
.auth-modal {
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.close-auth {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}
.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    display: none;
}
.auth-form.active {
    display: block;
}
.auth-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-form input,
.auth-form select,
.auth-form button {
    width: 100%;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
}
.auth-form button {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.auth-switch a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

/* Login Required Popup */
.login-required {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    z-index: 1002;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}


/* Responsive Styles */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }
    .nav-containers {
        flex: 0;
    }

    .mobile-nav-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem; /* Tighter padding */
        height: 60px; /* Smaller height */
    }
    .logo-img {
        height: 40px;
    }
    .logo-main {
        font-size: 1rem;
    }
    .logo-sub {
        font-size: 0.6rem;
    }
}