/* ============================================
   BASIC RESET AND LAYOUT
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Create space for fixed header */
.main {
    margin-top: 80px;
    transition: margin-top 0.3s ease;
}

.wc_statusbar:not([style*="display: none"]) ~ .header ~ .main {
    margin-top: 0px;
}

.wc_statusbar.collapsed ~ .header ~ .main {
    margin-top: 80px;
}

/* ============================================
   STATUSBAR STYLES
   ============================================ */

.wc_statusbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1001 !important;
    transition: transform 0.3s ease !important;
}

.wc_statusbar.collapsed {
    transform: translateY(-100%);
}

/* ============================================
   HEADER STYLES
   ============================================ */

.header {
    position: fixed !important;
    top: 40px;
    left: 0;
    right: 0;
    height: 100px;
    background: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
}

body:not(:has(.wc_statusbar)) .header {
    top: 0;
}

.wc_statusbar[style*="display: none"] ~ .header {
    top: 0;
}

.header.scrolled {
    top: 0;
    height: 60px;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header.admin-hidden {
    top: 0;
}

/* ============================================
   LOGO
   ============================================ */

.site-logo {
    display: flex;
    align-items: center;
    justify-self: start;
}

.site-logo img {
    height: 95px;
    width: auto;
    transition: height 0.3s ease;
}

.header.scrolled .site-logo img {
    height: 60px;
}

/* ============================================
   DESKTOP NAVIGATION
   ============================================ */

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    justify-self: center;
}

.main-nav {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
}

.main-nav ul.sm {
    display: flex !important;
    align-items: center !important;
    gap: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.main-nav ul.sm > li {
    position: relative;
}

.main-nav ul.sm > li > a {
    color: #333 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 10px 0 !important;
    transition: color 0.3s ease !important;
    white-space: nowrap !important;
    display: block !important;
}

.main-nav ul.sm > li > a:hover {
    color: #054930 !important;
}

/* Desktop submenu arrows */
.main-nav ul.sm > li:has(ul) > a {
    position: relative !important;
    padding-right: 15px !important;
}

.main-nav ul.sm > li:has(ul) > a::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
    transition: transform 0.3s ease;
}

.main-nav ul.sm > li:hover:has(ul) > a::after {
    transform: translateY(-50%) rotate(225deg);
}

/* Desktop submenus */
.main-nav ul.sm ul {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: #fff !important;
    min-width: 250px !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15) !important;
    padding: 16px 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
    border-top: 3px solid #054930 !important;
    list-style: none !important;
    margin: 0 !important;
}

.main-nav ul.sm li:hover > ul {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.main-nav ul.sm ul li a {
    padding: 12px 20px !important;
    color: #666 !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    display: block !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.main-nav ul.sm ul li:last-child a {
    border-bottom: none !important;
}

.main-nav ul.sm ul li a:hover {
    color: #054930 !important;
    background: #f8f9fa !important;
    padding-left: 24px !important;
}

.sm-buz a .sub-arrow {
    display: none !important;
}

.sm-buz a,
.sm-buz a:hover,
.sm-buz a:focus,
.sm-buz a:active {
    font-family: "Montserrat", sans-serif !important;
}

/* Override SmartMenus arrows */
.main-nav .sm ul a.has-submenu::after,
.main-nav .sm ul a.has-submenu::before {
    display: none !important;
}

/* ============================================
   MEMBERS BUTTON
   ============================================ */

.members-button {
    justify-self: end;
    display: flex;
    align-items: center;
}

/* ============================================
   CTA BUTTON
   ============================================ */

.cta-button {
    justify-self: end;
    display: flex;
    align-items: center;
}

.cta-button a {
    background: #054930;
    color: white !important;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.cta-button a:hover {
    background: #054930;
    transform: translateY(-2px);
}

/* ============================================
   MOBILE MENU TRIGGER
   ============================================ */

.mobile-menu-trigger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1102;
}

.hamburger {
    width: 25px;
    height: 20px;
    position: relative;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: #333;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.hamburger span:last-child {
    margin-bottom: 0;
}

/* Hamburger animation */
.mobile-menu.open ~ .mobile-menu-trigger .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu.open ~ .mobile-menu-trigger .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu.open ~ .mobile-menu-trigger .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   OFF-CANVAS MOBILE MENU
   ============================================ */

.mobile-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1100;
    padding: 20px;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu.open {
    left: 0;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MOBILE MENU STYLING
   ============================================ */

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu > ul > li {
    border-bottom: 1px solid #eee;
}

.mobile-menu li a {
    display: block;
    padding: 15px 0;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.mobile-menu li a:hover {
    color: #0057b8;
}

/* Mobile submenu */
.mobile-menu .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8f9fa;
    margin: 0 -20px;
    padding: 0 20px;
}

.mobile-menu .submenu.open {
    max-height: 500px;
}

.mobile-menu .submenu li {
    border-bottom: 1px solid #e0e0e0;
}

.mobile-menu .submenu li:last-child {
    border-bottom: none;
}

.mobile-menu .submenu li a {
    padding: 10px 0 10px 20px;
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

/* Mobile submenu toggle button */
.mobile-menu .has-submenu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

.mobile-menu .has-submenu > a {
    flex: 1;
    padding-right: 10px;
}

.mobile-menu .has-submenu > .submenu-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 48px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    padding: 0;
}

.mobile-menu .has-submenu > .submenu-toggle i {
    transition: transform 0.3s ease;
}

.mobile-menu .has-submenu.open > .submenu-toggle i {
    transform: rotate(180deg);
}

/* Submenu takes full width below the row */
.mobile-menu .has-submenu > .submenu {
    flex-basis: 100%;
}

/* Nested submenu items */
.mobile-menu .submenu .has-submenu > a {
    padding-right: 10px;
}

/* Mobile CTA */
.mobile-cta {
    margin-top: 30px;
    padding: 15px 20px;
    background: #054930;
    color: white;
    text-align: center;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: block;
    transition: background 0.3s ease;
}

.mobile-cta:hover {
    background: #003d82;
    color: white;
    text-decoration: none;
}

/* ============================================
   ADMIN DROPDOWN MOBILE (appended to body)
   ============================================ */

#admin-dropdown-mobile {
    display: none;
    position: fixed;
    top: 40px;
    left: 0;
    z-index: 9999;
    background: #2e2e2e;
    min-width: 180px;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

#admin-dropdown-mobile.open {
    display: block;
}

#admin-dropdown-mobile > li > a {
    color: #ffffff !important;
    padding: 8px 15px !important;
    display: block !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

#admin-dropdown-mobile > li > a:hover {
    background: #444 !important;
}

/* ============================================
   MOBILE STYLES
   ============================================ */

@media (max-width: 768px) {

    /* Hide statusbar for non-admin users */
    .wc_statusbar {
        display: none !important;
    }

    /* Show statusbar for admin users only */
    .wc_statusbar:has(.item-admin) {
        display: block !important;
    }

    /* Hide username on mobile to free up space */
    .wc_statusbar .navbar-text {
        display: none !important;
    }

    /* Statusbar navbar layout */
    .wc_statusbar .navbar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        min-height: 40px !important;
        max-height: 40px !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .wc_statusbar .navbar-header {
        display: none !important;
    }

    /* Force Bootstrap collapse open and scrollable */
    .wc_statusbar .navbar-collapse.collapse {
        display: flex !important;
        visibility: visible !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        height: 40px !important;
        max-height: 40px !important;
        padding: 0 !important;
        flex: 1 !important;
        align-items: center !important;
    }

    /* Nav links in a scrollable row */
    .wc_statusbar .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        float: none !important;
        white-space: nowrap !important;
        margin: 0 !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    .wc_statusbar .navbar-nav > li {
        float: none !important;
        display: inline-block !important;
    }

    /* Fix vertical alignment of nav links */
    .wc_statusbar .navbar-nav > li > a {
        line-height: 40px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Main content clears statusbar + header */
    .main {
        margin-top: 110px !important;
    }

    /* Header switches to flex on mobile */
    .header {
        display: flex !important;
        top: 40px !important;
        height: 70px;
        background: rgba(255, 255, 255, 1);
        padding: 0 10px;
        justify-content: space-between;
    }

    /* For non-admin users, statusbar is hidden so header moves to top */
    .wc_statusbar:not(:has(.item-admin)) ~ .header {
        top: 0 !important;
    }

    .wc_statusbar:not(:has(.item-admin)) ~ .header ~ .main {
        margin-top: 70px !important;
    }

    .site-logo {
        margin-right: 0 !important;
    }

    .site-logo img {
        height: 35px;
    }

    .header.scrolled .site-logo img {
        height: 28px;
    }

    /* Hide desktop nav and CTA */
    .nav-container,
    .cta-button {
        display: none;
    }

    /* Show hamburger */
    .mobile-menu-trigger {
        display: block;
    }

    /* Mobile menu starts below statusbar + header for admins */
    .mobile-menu {
        top: 110px;
        height: calc(100vh - 110px);
        z-index: 1100;
    }

    .mobile-menu-overlay {
        top: 110px;
        height: calc(100vh - 110px);
        z-index: 1099;
    }

    /* For non-admin users, mobile menu starts just below header */
    .wc_statusbar:not(:has(.item-admin)) ~ .header ~ * .mobile-menu,
    .wc_statusbar:not(:has(.item-admin)) ~ * .mobile-menu {
        top: 70px;
        height: calc(100vh - 70px);
    }
}

/* ============================================
   HIDE COLDFUSION HAMBURGER
   ============================================ */

.nav-container .main-menu-btn {
    display: none !important;
}

#main-menu-state {
    display: none !important;
}     