/* ====================================
   REUSABLE NAVBAR COMPONENT
   ==================================== */

/* Base Navbar Styles */
.main-navbar {
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    min-height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Afacad Flux', sans-serif;

}

/* Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    font-family: 'Afacad Flux', sans-serif;

}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
    font-family: 'Afacad Flux', sans-serif;

}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation List */
#nav-ul {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    list-style-type: none;
    margin: 0;
    padding: 0;
    gap: 40px;
    flex: 1;
}

#nav-ul li {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide mobile logo on desktop */
#logo-image-mobile {
    display: none !important;
}

/* Navbar brand positioning */
.navbar-brand {
    display: flex;
    align-items: center;
    order: 1;
}

.navbar-brand img {
    max-width: 60px;
    height: auto;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.1);
}

/* Navigation Links */
#nav-ul li a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

#nav-ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

#nav-ul li a:hover::before {
    left: 100%;
}

#nav-ul li a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Login Button */
#log-in-btn {
    display: flex;
    align-items: center;
}

#log-in-btn a {
    background: transparent;
    color: white;
    padding: 10px 20px;
    border: 0px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-size: 1.0em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: none;
}

#log-in-btn a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 1);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

/* Profile Image */
#profile-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

#profile-img:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

/* Profile Menu */
.profile-menu {
    display: none;
    position: fixed;
    top: 90px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    z-index: 1000;
    width: auto;
    min-width: 180px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-menu ul {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

.profile-menu ul li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.profile-menu ul li:last-child {
    border-bottom: none;
}

.profile-menu ul li:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.profile-menu ul li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.profile-menu ul li:hover a {
    color: #007bff;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; 
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto; 
}

/* ====================================
   RESPONSIVE BREAKPOINTS
   ==================================== */

/* Tablet Responsive */
@media only screen and (max-width: 1024px) {
    .main-navbar {
        padding: 0 3%;
    }
    
    #nav-ul {
        gap: 25px;
    }
}

/* Desktop Layout */
@media only screen and (min-width: 769px) {
    .main-navbar {
        justify-content: space-between;
    }
    
    .navbar-brand {
        order: 1;
    }
    
    #nav-ul {
        order: 2;
        flex: 1;
        justify-content: center;
    }
    
    .navbar-right {
        order: 3;
        margin-left: auto;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    #log-in-btn {
        display: flex;
        align-items: center;
    }
}

/* Mobile Large */
@media only screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    #logo-image-mobile {
        display: none !important;
    }
    
    .main-navbar {
        justify-content: space-between;
        padding: 15px 20px;
        min-height: 70px;
        display: flex;
        align-items: center;
        position: relative;
    }
    
    .navbar-brand {
        display: flex;
        align-items: center;
        order: 1;
        flex-shrink: 0;
    }
    
    .navbar-brand img {
        max-height: 40px;
        width: auto;
    }
    
    .navbar-right {
        display: flex;
        align-items: center;
        gap: 15px;
        order: 3;
    }
    
    #log-in-btn {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }
    
    #log-in-btn a {
        background: transparent;
        color: white;
        padding: 0;
        border-radius: 18px;
        border: 0; 
        text-decoration: none;
        font-weight: 500;
        font-size: 0.8em;
        transition: all 0.3s ease;
        white-space: nowrap;
        box-shadow: none;
    }
    
    #log-in-btn a:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: 0px rgba(255, 255, 255, 1);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
    }
    
    #profile-img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.3s ease;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    #profile-img:hover {
        transform: scale(1.05);
        border-color: rgba(255, 255, 255, 0.6);
    }
    
    .mobile-menu-toggle {
        flex-shrink: 0;
        position: relative;
        z-index: 1001;
    }
        
    #nav-ul {
        position: fixed;
        top: 70px; /* Fixed to match min-height of navbar */
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.95);
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 50px;
        gap: 30px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        order: 0;
    }
    
    #nav-ul.mobile-open {
        transform: translateX(0);
    }
    
    #nav-ul li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.3s ease;
    }
    
    #nav-ul.mobile-open li {
        opacity: 1;
        transform: translateY(0);
    }
    
    #nav-ul.mobile-open li:nth-child(2) { transition-delay: 0.1s; }
    #nav-ul.mobile-open li:nth-child(3) { transition-delay: 0.2s; }
    
    #nav-ul li a {
        font-size: 1.3em;
        padding: 15px 30px;
        margin: 0 20px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.05);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }
    
    #nav-ul li a:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
    }
    
    .profile-menu {
        right: 10px;
        top: 80px;
        min-width: 160px;
    }
    
    .mobile-overlay {
        display: none;
    }

    .mobile-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
}

/* Mobile Medium */
@media only screen and (max-width: 480px) {
    .main-navbar {
        padding: 12px 15px;
        min-height: 65px;
    }
    
    .navbar-brand img {
        max-height: 35px;
    }
    
    .navbar-right {
        gap: 12px;
    }
    
    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
    }
    
    #log-in-btn a {
        padding: 0;
        border: 0px solid rgba(255, 255, 255, 0.7);
        border-radius: 15px;
        font-size: 0.75em;
    }
    
    #profile-img {
        width: 35px;
        height: 35px;
    }
    
    #nav-ul {
        top: 65px; /* Match min-height of navbar */
        height: calc(100vh - 65px);
        padding-top: 40px;
        gap: 25px;
    }
    
    #nav-ul li a {
        font-size: 1.2em;
        padding: 12px 25px;
        margin: 0 15px;
    }
    
    .profile-menu {
        top: 70px;
        right: 5px;
        min-width: 150px;
    }
    
    .profile-menu ul li a {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Mobile Small */
@media only screen and (max-width: 360px) {
    .main-navbar {
        padding: 10px 12px;
        min-height: 60px;
    }
    
    .navbar-brand img {
        max-height: 30px;
    }
    
    .navbar-right {
        gap: 10px;
    }
    
    .mobile-menu-toggle {
        width: 25px;
        height: 25px;
    }
    
    #log-in-btn a {
        border-radius: 12px;
        font-size: 0.7em;
    }
    
    #profile-img {
        width: 30px;
        height: 30px;
    }
    
    #nav-ul {
        top: 60px; /* Match min-height of navbar */
        height: calc(100vh - 60px);
        padding-top: 30px;
        gap: 20px;
    }
    
    #nav-ul li a {
        font-size: 1.1em;
        padding: 10px 20px;
        margin: 0 10px;
    }
}

/* Landscape orientation for mobile */
@media only screen and (max-height: 500px) and (orientation: landscape) {
    .main-navbar {
        min-height: 60px;
        padding: 8px 15px;
    }
    
    .navbar-brand img {
        max-height: 35px;
    }
    
    .navbar-right {
        gap: 12px;
    }
    
    #log-in-btn a {
        border-radius: 15px;
        font-size: 0.75em;
    }
    
    #profile-img {
        width: 35px;
        height: 35px;
    }
    
    #nav-ul {
        top: 60px; /* Match min-height of navbar */
        height: calc(100vh - 60px);
        padding-top: 20px;
        gap: 15px;
    }
    
    #nav-ul li a {
        padding: 8px 20px;
        font-size: 1em;
    }
}

* {
    box-sizing: border-box;
}

body.mobile-menu-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Update the mobile overlay to also prevent scrolling */
.mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
    overflow: hidden;
}