/* General Reset */
* {
    box-sizing: border-box;
}

body {
    padding-top: 0; /* Ensure the content isn't pushed down by the navbar */
}

html {
    scroll-behavior: smooth;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-between; /* Space between hamburger, links, and user icon */
    align-items: center;
    z-index: 10; /* Stays above the video */
    transition: background-color 0.3s ease;
}

/* User Icon */
.user-icon {
    display: none; /* Hidden by default (on desktop) */
    cursor: pointer;
}

.user-icon img {
    height: 35px; /* Same height as the hamburger bars */
    width: 35px; /* Same width as the hamburger bars */
}

.user-icon-desktop {
    display: none; /* Desktop version of user icon, hidden on mobile */
}

.user-icon-desktop img {
    height: 35px; /* Same height as the hamburger bars */
    width: 35px; /* Same width as the hamburger bars */
}

/* Navbar Links */
.navbar-links {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0 auto; /* Center links */
    font-family: "Quattrocento", serif;
}

.navbar-links li {
    display: inline-block;
}

.navbar-links a {
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    color: white; /* Default link color */
    transition: color 0.3s ease; /* Smooth transition for color change */
}

.navbar-links a:hover {
    color: #034f25; /* Change color on hover */
}

.navbar.scrolled {
    background-color: rgba(
        0,
        0,
        0,
        0.4
    ); /* The color of navbar when scrolling */
}

/* Hamburger Styles */
.hamburger {
    display: none; /* Hide hamburger by default */
    flex-direction: column;
    cursor: pointer;
    margin-right: 10px; /* Push hamburger 10px from the right */
    z-index: 30; /* Make sure hamburger stays on top */
}

.bar {
    height: 6px; /* Height of the hamburger lines */
    width: 35px; /* Width of the hamburger lines */
    background-color: white; /* Color of the hamburger lines */
    margin: 4px 0; /* Space between the lines */
    transition: 0.3s; /* Smooth transition for transforming into an X */
    border-radius: 3px; /* Added border radius for rounded edges */
}

/* Transform hamburger into an X when the sidebar is active */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px); /* Top bar becomes part of X */
    width: 40px; /* Increase width to make the X more pronounced */
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0; /* Hide the middle bar */
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(12px, -12px); /* Bottom bar becomes part of X */
    width: 40px; /* Increase width to make the X more pronounced */
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 60px; /* This will open the sidebar just under the navbar */
    left: 0;
    width: 100%;
    height: 0; /* Initially hidden by setting height to 0 */
    background-color: rgba(
        0,
        0,
        0,
        0.4
    ); /* Same color as navbar when scrolling */
    transition: height 0.3s ease; /* Smooth transition for opening/closing */
    z-index: 20; /* Ensure sidebar is above all content */
    overflow: hidden; /* Ensure content is hidden when the sidebar is closed */
}

.sidebar.active {
    height: 40vh; /* Sidebar will open with a height of 40vh */
}

.sidebar-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-family: "Quattrocento", serif;
}

.sidebar-links li {
    margin: 15px 0; /* Spacing between items */
}

.sidebar-links a {
    color: white; /* Link color in sidebar */
    text-decoration: none;
    font-size: 18px;
    font-weight: 600; /* Make text bold */
}

/* Dropdown Styles */
.user-dropdown {
    position: absolute;
    top: 60px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.4); /* Same color as sidebar */
    padding: 0; /* Remove padding initially */
    border-radius: 0 0 5px 5px;
    z-index: 100; /* Above the navbar */
    width: 150px; /* Width for the dropdown */
    max-height: 0; /* Initially collapsed */
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease; /* Smooth folding effect */
}

.user-dropdown.active {
    max-height: 120px; /* Unfold to fit content */
    padding: 10px; /* Add padding when active */
}

.user-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-dropdown li {
    margin: 10px 0;
}

.user-dropdown a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-family: "Quattrocento", serif;
}

.user-dropdown a:hover {
    color: #089849;
}

.logout-button {
    background-color: #00000000;
    border: none;
    border-collapse: collapse;
    color: #fff;
    font-family: "Quattrocento", serif;
    font-size: 16px;
    margin-left: -5px;
}

/* Mobile dropdown */
@media (max-width: 768px) {
    .navbar-links {
        display: none; /* Hide links on smaller screens */
    }

    .hamburger {
        display: flex; /* Show hamburger on smaller screens */
        margin-left: auto; /* Ensure hamburger is on the right */
    }

    .user-icon {
        display: block; /* Show user icon before the hamburger on mobile */
        margin-left: 10px;
        height: 35px; /* Same height as the hamburger */
        width: 35px; /* Same width as the hamburger */
    }

    .user-icon img {
        height: 35px; /* Match the height of the hamburger */
        width: 35px; /* Match the width of the hamburger */
    }

    .user-icon-desktop {
        display: none; /* Hide desktop user icon on mobile */
    }

    /* Mobile dropdown */
    .user-dropdown {
        position: fixed;
        top: 60px; /* Same margin as sidebar */
        left: 0;
        width: 100%;
        max-height: 0; /* Start with max-height 0 */
        background-color: rgba(
            0,
            0,
            0,
            0.4
        ); /* Same background as sidebar/navbar when scrolling */
        transition: max-height 0.3s ease, padding 0.3s ease; /* Smooth folding effect */
        z-index: 100;
        overflow: hidden;
    }

    .user-dropdown.active {
        max-height: 120px; /* Unfold just enough to fit content */
        padding: 10px; /* Add padding when active */
    }

    .user-dropdown ul {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: auto; /* Adjust height dynamically */
    }

    .user-dropdown li {
        margin: 15px 0;
    }

    .user-dropdown a {
        font-size: 18px;
        font-weight: 600;
        color: white;
    }
}

@media (min-width: 769px) {
    .user-icon {
        display: none; /* Hide mobile user icon on desktop */
    }

    .user-icon-desktop {
        display: block; /* Show desktop user icon */
        margin-right: 15px;
    }
}
