/* Navigation Styles - Header, nav links, dropdowns, mobile menu, footer, auth */

/* Header Styles */
.header {
    background: white;
    padding: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
}

/* Admin Header Styling */
body.admin-page .header {
    background: #f8f9fa;
    border-bottom: 2px solid #2d5f3f;
}

body.admin-page .nav-link {
    color: #666 !important;
    opacity: 0.7 !important;
    text-decoration: none !important;
}

body.admin-page .nav-link:hover {
    color: #2d5f3f !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

body.admin-page .nav-item a {
    color: #666 !important;
    opacity: 0.7 !important;
    text-decoration: none !important;
}

body.admin-page .nav-item a:hover {
    color: #2d5f3f !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

/* Override any visited/active link styles in admin */
body.admin-page a:visited,
body.admin-page a:active,
body.admin-page .nav-link:visited,
body.admin-page .nav-link:active,
body.admin-page .nav-item a:visited,
body.admin-page .nav-item a:active {
    color: #666 !important;
    text-decoration: none !important;
    opacity: 0.7 !important;
}

body.admin-page a:visited:hover,
body.admin-page a:active:hover,
body.admin-page .nav-link:visited:hover,
body.admin-page .nav-link:active:hover,
body.admin-page .nav-item a:visited:hover,
body.admin-page .nav-item a:active:hover {
    color: #2d5f3f !important;
    text-decoration: none !important;
    opacity: 1 !important;
}

/* Keep footer links visible after visiting */
body.admin-page .site-footer a:visited,
body.admin-page .site-footer a:active,
.site-footer a:visited,
.site-footer a:active {
    color: #e8f5e8 !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

body.admin-page .site-footer a:visited:hover,
.site-footer a:visited:hover {
    color: white !important;
    opacity: 1 !important;
}


.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 3rem;
    flex-wrap: nowrap;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #333;
    font-size: 11pt;
    flex-shrink: 0;
    margin-right: 4rem; /* Add extra space after logo */
}

.logo a {
    display: block;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
}

.logo img {
    height: auto;
    width: auto;
    max-height: 45px;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1rem; /* Reduced gap for more compact nav items */
    flex-shrink: 0;
    flex: 1; /* Take up remaining space */
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 400;
    padding: 0.75rem 0.75rem; /* Reduced horizontal padding for compactness */
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 10pt;
    white-space: nowrap;
}

.nav-link:hover {
    color: #2d5f3f;
}

.nav-icon {
    display: none;
}

.nav-item.has-submenu {
    position: relative;
}

.nav-link-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
}

.submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem 0.5rem;
    margin: 0;
}

.submenu-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #555;
    transition: transform 0.25s ease-out;
}

.submenu-toggle:hover .submenu-arrow {
    border-top-color: #2d5f3f;
}

.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease-out;
}

.nav-item.has-submenu:hover .nav-submenu,
.nav-item.has-submenu.expanded .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-item.has-submenu:hover .submenu-arrow,
.nav-item.has-submenu.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.nav-submenu li {
    margin: 0;
    padding: 0;
}

.nav-submenu li a {
    display: block;
    padding: 0.6rem 1rem;
    color: #555;
    text-decoration: none;
    font-size: 9pt;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-submenu li a:hover {
    background: #f5f5f5;
    color: #2d5f3f;
}

.nav-submenu li a.active {
    color: #2d5f3f;
    font-weight: 500;
    background: #e8f5e9;
}


/* Authentication Styles */
.auth-item {
    position: relative;
    flex-shrink: 0; /* Prevent the auth item from shrinking */
    margin-left: auto; /* Push to the right */
}

.user-profile {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    min-width: 40px; /* Ensure minimum width */
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile:hover {
    background-color: #f5f5f5;
}

.profile-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-icon {
    color: #555;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.user-profile:hover .profile-icon {
    color: #2d5f3f;
}

.signin-tooltip {
    display: none;
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #2d5f3f;
    color: white;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1000;
}

.signin-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #2d5f3f;
}

.signin-tooltip.visible {
    display: block;
    opacity: 1;
}

.signin-tooltip.fade-out {
    opacity: 0;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
    60% { transform: translateY(-2px); }
}

.profile-icon-wrapper.bounce .profile-icon {
    animation: gentleBounce 0.6s ease 3;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px; /* Reduced from 200px to save space */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping */
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content {
    padding: 0.5rem 0;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 10pt;
    transition: background-color 0.3s ease;
}

.dropdown-link:hover {
    background-color: #f8f9fa;
    color: #2d5f3f;
}

.user-name {
    display: block;
    padding: 0.75rem 1rem;
    color: #666;
    font-size: 10pt;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

/* Ensure nav menu has proper flex layout */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1; /* Allow nav menu to grow but keep auth item visible */
}


/* Footer Styles */
.site-footer {
    background: #2d5f3f;
    color: white;
    padding: 3rem 0 2rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-logo-section {
    text-align: left;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-logo img {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-description {
    color: #e8f5e8;
    font-size: 10pt;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    font-size: 12pt;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: left;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #e8f5e8;
    text-decoration: none;
    font-size: 10pt;
    transition: color 0.3s ease;
}

.footer-section a:visited {
    color: #e8f5e8;
}

.footer-section a:hover {
    color: white;
}

.footer-contact {
    color: #e8f5e8;
    font-size: 10pt;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-contact strong {
    color: white;
}

.footer-social {
    margin-top: 1.5rem;
}

.footer-social a {
    display: inline-block;
    margin-right: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background 0.3s ease;
}

.footer-social a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
    text-align: center;
    color: #e8f5e8;
    font-size: 9pt;
}

.footer-bottom a {
    color: #e8f5e8;
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-bottom a:visited {
    color: #e8f5e8;
}

.footer-bottom a:hover {
    color: white;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-container {
        padding: 0 1.5rem;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    margin-right: 1rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

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

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

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


@media (max-width: 1024px) {
    .nav-container {
        padding: 0 2rem;
    }
    
    .logo {
        margin-right: 2rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 9pt;
    }
}


@media (max-width: 768px) {
    body {
        padding-top: 90px;
    }
    
    .nav-container {
        padding: 1rem 1.5rem;
        position: relative;
    }
    
    .logo {
        margin-right: 1rem;
        flex: 1;
    }
    
    .logo img {
        max-height: 35px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        flex-direction: column;
        padding: 90px 0 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #f0f0f0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
        gap: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-item.has-submenu {
        flex-direction: column;
    }
    
    .nav-link-wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }
    
    .nav-link-wrapper .nav-link {
        flex: 1;
        text-align: left;
        padding-left: 1.5rem;
    }
    
    .submenu-toggle {
        padding: 1rem;
        border-left: 1px solid #e0e0e0;
    }
    
    .nav-item.has-submenu:hover .nav-submenu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
    }
    
    .nav-submenu {
        position: static;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transform: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        background: #f9f9f9;
        border-top: 1px solid #e0e0e0;
        transition: max-height 0.25s ease-out, opacity 0.25s ease-out, visibility 0.25s ease-out;
        padding: 0;
    }
    
    .nav-item.has-submenu.expanded .nav-submenu {
        opacity: 1;
        visibility: visible;
        max-height: 500px;
    }
    
    .nav-item.has-submenu.expanded .submenu-toggle .submenu-arrow {
        transform: rotate(180deg);
    }
    
    .nav-submenu li {
        width: 100%;
    }
    
    .nav-submenu li a {
        display: block;
        padding: 0.75rem 2rem;
        color: #666;
        text-decoration: none;
        font-size: 9pt;
        transition: all 0.2s ease;
        border-bottom: 1px solid #e8e8e8;
        text-align: left;
    }
    
    .nav-submenu li:last-child a {
        border-bottom: none;
    }
    
    .nav-submenu li a:hover {
        background: #f0f0f0;
        color: #2d5f3f;
    }
    
    .nav-submenu li a.active {
        color: #2d5f3f;
        font-weight: 500;
        background: #e8f5e9;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
        font-size: 10pt;
        border-radius: 0;
    }
    
    .auth-item {
        margin-left: 0;
        padding: 1rem 0;
        display: flex;
        justify-content: center;
    }
}


@media (max-width: 480px) {
    body {
        padding-top: 80px;
    }
    
    .nav-menu {
        padding-top: 80px;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .logo img {
        max-height: 30px;
    }
}
