/* Navbar specific styles from _Layout.cshtml */
.navbar {
    background-color: #387a29;
    transition: all 0.3s ease;
    /* Samsung Browser & Edge compatibility */
    position: relative !important;
    z-index: 1050 !important; /* Above feedback popup (1035) and dropdowns (1000), below modals (1055) */
}

.navbar.shrink {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    background-color: rgba(56, 122, 41, 0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    /* Consider adding position: fixed; top: 0; width: 100%; z-index: 1030; if sticky-top causes issues */
}

.navbar-logo {
    max-height: 48px;
    transition: all 0.3s ease;
}

.shrink .navbar-logo {
    max-height: 40px;
}

.nav-link {
    color: #ffffff !important;
    position: relative;
    transition: all 0.3s ease;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #ffffff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    font-weight: 600;
}

.search-wrapper {
    position: relative;
    /* flex: 1; */ /* Let bootstrap grid handle sizing */
    /* max-width: 300px; */ /* Let bootstrap grid handle sizing */
}

.search-input {
    border-radius: 50px;
    border: none;
    padding-left: 15px;
    padding-right: 40px;
    height: 38px;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.user-greeting {
    color: white;
    margin-right: 0.5rem;
    font-weight: 500;
}

.mail-icon {
    position: relative;
    font-size: 1.2rem;
    color: white;
    transition: all 0.2s ease;
    padding-bottom: 2px; /* Add space for underline */
}

.mail-icon:hover {
    color: var(--accent-color) !important; /* Change to yellow on hover */
    /* transform: scale(1.1); Removed scale transform */
}

/* Add underline effect */
.mail-icon::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: #ffffff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.mail-icon:hover::after {
    width: 100%;
}

/* Remove the explicit media query for layout, rely on Bootstrap */
/* @media (max-width: 991.98px) {
    .center-group, .right-group {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .search-wrapper {
        max-width: 100%;
        margin: 0.5rem 0;
    }
    
    .navbar-brand {
        margin-right: auto;
    }
    
    .right-group {
        justify-content: flex-end;
    }
} */

/* Styles for suggestion input (if needed, can be enhanced) */
.suggestion-input {
    position: absolute;
    left: 16px; /* Match input padding */
    top: 0;
    height: 100%;
    line-height: 38px; /* Match input height */
    color: grey;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block; /* Needed for text measurement */
}

/* Spelling suggestion styling */
.spelling-suggestion {
    background-color: #f0f7ed;
    border-left: 4px solid #387a29;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0 0 8px 8px;
    margin-top: -5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: absolute;
    z-index: 1050;
    width: 100%;
}

.spelling-suggestion:hover {
    background-color: #e6f2e1;
}

.spelling-suggestion .text-success {
    color: #387a29 !important;
}

.spelling-suggestion .use-suggestion {
    text-decoration: underline;
}

.spelling-suggestion .use-suggestion:hover {
    text-decoration: underline wavy #387a29;
}

/* Message dropdown styles */
.message-dropdown .message-list {
    max-height: 300px;
    overflow-y: auto;
    
    /* Hide scrollbar while keeping functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for webkit browsers */
.message-dropdown .message-list::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
}

.message-dropdown .message-item:hover {
    background-color: #f8f9fa;
}

.message-dropdown .empty-message {
    color: #6c757d;
}

/* ===== MOBILE NAVBAR ICON CENTERING ===== */
@media (max-width: 991.98px) {
    /* Ensure the main container has proper vertical alignment */
    .navbar-collapse .col-lg-auto.order-lg-3 {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.75rem; /* Consistent spacing between elements */
    }
    
    /* Individual icon styling */
    .mail-icon {
        padding: 0.5rem;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding-bottom: calc(0.5rem + 2px); /* Add space for underline */
        height: 3rem; /* Consistent height */
        width: 3rem; /* Consistent width */
        margin-right: 0 !important; /* Remove individual margins, use gap instead */
    }
    
    .mail-icon::after {
        bottom: 0.5rem;
    }
    
    .notification-bell {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 3rem; /* Consistent height */
        width: 3rem; /* Consistent width */
        margin-right: 0 !important; /* Remove individual margins, use gap instead */
    }
    
    /* User account toggle consistency - only for mobile version */
    .user-account-toggle.d-lg-none {
        display: flex !important;
        align-items: center !important;
        height: 3rem; /* Consistent height */
        margin-left: 0 !important; /* Remove individual margins, use gap instead */
    }
    
    /* Hide desktop version in mobile */
    .user-account-toggle.d-none {
        display: none !important;
    }
    
    /* Premium badge container alignment */
    .premium-badge-container {
        display: flex;
        align-items: center;
        height: 3rem; /* Consistent height */
    }
    

    
    .mobile-panel-content {
        background: linear-gradient(to bottom, #387a29 0%, #2d5f20 100%) !important;
    }
    .mobile-section-title {
        color: rgba(255, 255, 255, 0.7);
        padding: 0 1.25rem;
        margin: 1.5rem 0 0.75rem 0;
        font-weight: 600;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
    .mobile-menu-section {
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    .mobile-menu-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    /* Mobile panel search bar styling */
    .mobile-panel-search {
        margin-bottom: 0.5rem;
    }
    .mobile-search-input {
        border-radius: 25px !important;
        border: none;
        background: #f4f8f2;
        color: #387a29;
        font-size: 1rem;
        padding-left: 1rem;
        box-shadow: 0 1px 4px rgba(56,122,41,0.08);
    }
    .mobile-search-input:focus {
        outline: none;
        box-shadow: 0 0 0 2px #4fa34d33;
        background: #fff;
    }
    .btn-search {
        border-radius: 25px !important;
        background: #4fa34d;
        color: #fff;
        border: none;
        padding: 0 1rem;
        font-size: 1.2rem;
        transition: background 0.2s;
    }
    .btn-search:hover, .btn-search:focus {
        background: #387a29;
        color: #fff;
    }
}

/* ===== MOBILE USER PANEL STYLES (V2 - Clean & Simple) ===== */

/* Panel container - fixed positioning and z-index with Safari fixes */
.mobile-user-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Use vh instead of % for Safari */
    z-index: 1060; /* Reduced from 9999 to prevent conflicts with Bootstrap modals */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none; /* Hidden by default */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Show and activate panel */
.mobile-user-panel.active {
    display: block;
    pointer-events: all;
    opacity: 1;
}

/* Overlay to darken and blur the main page content */
.mobile-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* Subtle dark overlay */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-user-panel.active .mobile-panel-overlay {
    opacity: 1;
}

/* Main panel content - clean and simple design */
.mobile-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px; /* Wider panel for better UX */
    max-width: 92vw; /* Slightly wider max width */
    height: 100vh;
    
    /* Clean semi-transparent background */
    background-color: rgba(45, 99, 32, 0.92); /* #2d6320 with good transparency */
    
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Keep hidden to contain content, scrolling happens in mobile-panel-body */
    
    -webkit-transform: translateX(100%);
    -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mobile-user-panel.active .mobile-panel-content {
    transform: translateX(0);
    -webkit-transform: translateX(0);
}

/* Simple clean header */
.mobile-panel-header {
    padding: 1.5rem; /* More padding for wider panel */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mobile-panel-header .h5 {
    font-weight: 600;
    line-height: 1.3;
    color: white;
}

/* Modern square close button - matches card-based design system */
.mobile-panel-close {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.4rem;
    border-radius: 8px; /* Square with rounded corners - matches card design */
    width: 48px;  /* Meets touch target standards */
    height: 48px; /* Meets touch target standards */
    padding: 0;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    
    /* Samsung Browser & Edge Mobile Fixes */
    touch-action: manipulation !important;
    pointer-events: auto !important;
    z-index: 1060 !important; /* Above mobile panel content */
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3) !important;
}

.mobile-panel-close:hover,
.mobile-panel-close:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    outline: none;
}

.mobile-panel-close:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* REFINED AUTH BUTTONS SECTION */
.mobile-auth-buttons {
    padding: 1.5rem; /* More breathing room and consistent padding */
    text-align: center;
    
    /* SUBTLE GRADIENT */
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* SOPHISTICATED LOGIN BUTTON */
.login-btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.75rem;
    
    /* REFINED STYLING */
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: 12px; /* More modern rounded corners */
    
    /* ELEGANT OUTLINE STYLE */
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%
    );
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.92);
    
    /* SUBTLE EFFECTS */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.login-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.08) 100%
    );
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* SOPHISTICATED REGISTER BUTTON - Toned down yellow with gradients */
.register-btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    
    /* REFINED STYLING */
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: 12px; /* More modern rounded corners */
    
    /* ELEGANT YELLOW GRADIENT - Much more subtle */
    background: linear-gradient(
        135deg,
        rgba(255, 193, 7, 0.85) 0%,
        rgba(255, 206, 84, 0.8) 50%,
        rgba(255, 215, 120, 0.75) 100%
    );
    border: 1.5px solid rgba(255, 193, 7, 0.4);
    color: #1a4015; /* Dark green text for contrast */
    
    /* SOPHISTICATED EFFECTS */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 3px 12px rgba(255, 193, 7, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.register-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(255, 193, 7, 0.92) 0%,
        rgba(255, 206, 84, 0.88) 50%,
        rgba(255, 215, 120, 0.85) 100%
    );
    border-color: rgba(255, 193, 7, 0.6);
    color: #1a4015;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(255, 193, 7, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Navigation Section */
.mobile-menu-section {
    padding: 0.5rem 0;
}

.mobile-section-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.25rem 0.5rem;
    margin-bottom: 0.5rem;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    /* Ensure proper touch handling for scrolling */
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.mobile-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.mobile-menu-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1rem;
    opacity: 0.8;
}

.mobile-panel-search {
    padding: 1rem 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-panel-search .form-control {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.mobile-panel-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.mobile-panel-search .form-control:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

.mobile-panel-search .btn-search {
    background: #387a29;
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    padding: 0.75rem 1.5rem;
    min-width: 60px;
    width: auto;
    box-sizing: border-box;
}

.mobile-panel-search .btn-search:hover {
    background: #2d6320; /* Darker green */
}

/* General menu item adjustments */
.mobile-auth-buttons .mobile-menu-item,
.mobile-menu-section .mobile-menu-item {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.mobile-panel-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto; /* Push footer to the bottom */
}

.mobile-logout-btn {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    width: 100%;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-logout-btn:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.8);
}

/* Hide desktop dropdown menu on mobile */
@media (max-width: 991.98px) {
    #userAccountDropdown + .dropdown-menu {
        display: none !important;
    }
}

/* Safari-specific fix: ensure dropdown menus sit above autocomplete & suggestion overlays */
.dropdown-menu {
    z-index: 1040; /* Above feedback popup (1035) but below navbar (1050) and modals (1055) */
}

/* Safari-specific fixes for dropdown items after headers/dividers */
@supports (-webkit-appearance: none) {
    .dropdown-menu .dropdown-item {
        position: relative;
        z-index: 1;
        display: block;
        width: 100%;
        padding: 0.5rem 1rem;
        clear: both;
        font-weight: 400;
        color: #212529;
        text-align: inherit;
        text-decoration: none;
        white-space: nowrap;
        background-color: transparent;
        border: 0;
        pointer-events: auto !important;
    }
    
    .dropdown-menu .dropdown-item:hover,
    .dropdown-menu .dropdown-item:focus {
        color: #1e2125;
        background-color: #e9ecef;
        pointer-events: auto !important;
    }
    
    .dropdown-menu .dropdown-header {
        display: block;
        padding: 0.5rem 1rem;
        margin-bottom: 0;
        font-size: 0.875rem;
        color: #6c757d;
        white-space: nowrap;
        pointer-events: none;
    }
    
    .dropdown-menu .dropdown-divider {
        height: 0;
        margin: 0.5rem 0;
        overflow: hidden;
        border-top: 1px solid rgba(0, 0, 0, 0.15);
        pointer-events: none;
    }
    
    /* Ensure form elements inside dropdown work properly */
    .dropdown-menu form {
        margin: 0;
        padding: 0;
    }
    
    .dropdown-menu form .dropdown-item {
        cursor: pointer;
    }
}

/* Panel Body - scrollable content area with seamless scrolling */
.mobile-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    padding: 0 0 8rem 0; /* Much larger bottom padding to ensure all content is always reachable */
    -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
    overscroll-behavior: contain; /* Prevent overscroll bounce from affecting parent */
    min-height: 0; /* Ensure flex item can shrink below content size */
    
    /* Enhanced scrolling support for all browsers */
    scrollbar-width: thin; /* Show thin scrollbar on Firefox for better UX */
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent; /* Subtle scrollbar colors */
    
    /* Fallback for browsers that don't support smooth scrolling */
    scroll-behavior: smooth;
    
    /* Ensure content can always be scrolled on all mobile browsers */
    max-height: calc(100vh - 200px); /* Ensure there's always room to scroll */
    
    /* Add a subtle scroll indicator at the bottom */
    position: relative;
    
    /* Ensure proper touch handling for scrolling */
    touch-action: pan-y;
    pointer-events: auto;
}

/* Add a visual indicator when content extends beyond visible area */
.mobile-panel-body::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(
        to top,
        rgba(45, 99, 32, 0.9) 0%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 10;
}

/* Show subtle scrollbar on webkit browsers for better mobile UX */
.mobile-panel-body::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}

.mobile-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.mobile-panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* --- BUTTON FIXES & BRAND ALIGNMENT --- */

/* Login/Register Button Section */
.mobile-auth-buttons {
    padding: 1rem 1.25rem 1.5rem; /* More padding */
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Login button styled as the site's secondary/outline button */
.login-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem; /* Space between buttons */
    
    /* Core button styles from site.css */
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: 50px; /* Rounded pill shape */
    transition: all 0.2s ease;

    /* Secondary outline style */
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: rgba(255, 255, 255, 0.9);
}

.login-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
    transform: translateY(-2px);
}

/* Register button styled as the site's primary button */
.register-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    
    /* Core button styles from site.css */
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border-radius: 50px; /* Rounded pill shape */
    transition: all 0.2s ease;
    
    /* Primary button style */
    background: #ffc107; /* Site's accent color for CTA */
    border: 2px solid #ffc107;
    color: #1f4a18; /* Dark green text for contrast */
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.register-btn:hover {
    background: #ffca2c;
    border-color: #ffca2c;
    color: #1f4a18;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
}

/* REFINED NAVIGATION SECTION */
.mobile-menu-section {
    padding: 1rem 0 0.75rem; /* Slightly more bottom padding for better spacing */
    
    /* SUBTLE DIVIDER GRADIENT */
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02) 0%,
        transparent 100%
    );
}

/* Ensure the last menu section has extra bottom padding for scroll accessibility */
.mobile-menu-section:last-child {
    padding-bottom: 2rem; /* Extra bottom padding for last section */
    margin-bottom: 2rem; /* Additional margin to ensure scrollability */
}

.mobile-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 1.5rem 0.75rem; /* More horizontal padding for wider panel */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* SOPHISTICATED MENU ITEMS */
.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem; /* More horizontal padding for wider panel */
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    
    /* SUBTLE HOVER BACKGROUND */
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.02) 50%,
        transparent 100%
    );
    
    border-left: 3px solid transparent;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

/* ADD SUBTLE SHINE EFFECT ON HOVER */
.mobile-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transition: left 0.5s ease;
}

.mobile-menu-item:hover::before {
    left: 100%;
}

.mobile-menu-item:hover {
    color: white;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    border-left-color: rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
    
    /* SUBTLE GLOW */
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.mobile-menu-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
}

.mobile-menu-item:hover i {
    color: rgba(255, 255, 255, 0.9);
}

/* POLISHED SEARCH SECTION */
.mobile-panel-search {
    padding: 1rem 1.5rem 1.5rem; /* More horizontal padding for wider panel */
    
    /* ELEGANT GRADIENT */
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-panel-search .form-control {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.08) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    
    /* FROSTED GLASS EFFECT */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.mobile-panel-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.mobile-panel-search .form-control:focus {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.12) 100%
    );
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

.mobile-panel-search .btn-search {
    background: linear-gradient(
        135deg,
        rgba(56, 122, 41, 0.9) 0%,
        rgba(45, 99, 32, 0.9) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    width: 100%;
    
    /* SOPHISTICATED EFFECTS */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mobile-panel-search .btn-search:hover {
    background: linear-gradient(
        135deg,
        rgba(56, 122, 41, 1) 0%,
        rgba(45, 99, 32, 1) 100%
    );
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ELEGANT FOOTER */
.mobile-panel-footer {
    padding: 1.5rem; /* More padding for wider panel */
    
    /* SOPHISTICATED GRADIENT BORDER */
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
    
    margin-top: auto; /* Push footer to the bottom */
    position: relative;
}

/* ADD TOP SHINE TO FOOTER */
.mobile-panel-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
}

.mobile-logout-btn {
    background: linear-gradient(
        135deg,
        rgba(220, 53, 69, 0.2) 0%,
        rgba(220, 53, 69, 0.15) 100%
    );
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    width: 100%;
    font-weight: 500;
    
    /* SOPHISTICATED EFFECTS */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 2px 8px rgba(220, 53, 69, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mobile-logout-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(220, 53, 69, 0.3) 0%,
        rgba(220, 53, 69, 0.25) 100%
    );
    border-color: rgba(220, 53, 69, 0.6);
    color: white;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(220, 53, 69, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* --- MOBILE AUTH BUTTONS: match search button style --- */
.mobile-auth-buttons .login-btn,
.mobile-auth-buttons .register-btn {
    display: block;
    width: 100%;
    background: #4fa34d;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.mobile-auth-buttons .login-btn:hover,
.mobile-auth-buttons .login-btn:focus,
.mobile-auth-buttons .register-btn:hover,
.mobile-auth-buttons .register-btn:focus {
    background: #387a29;
    color: #fff;
    transform: translateY(-2px);
}

/* Ensure any button in mobile-auth-buttons matches pill search style */
.mobile-auth-buttons .btn {
    background: #4fa34d !important;
    color: #fff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 0.75rem 1.5rem !important;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.mobile-auth-buttons .btn:hover,
.mobile-auth-buttons .btn:focus {
    background: #387a29 !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Final override: make unauthenticated Log In & Register buttons identical to search button gradient */
.mobile-user-panel .mobile-menu-section .btn.btn-success,
.mobile-user-panel .mobile-menu-section .btn.btn-outline-light {
    background: linear-gradient(
        135deg,
        rgba(56, 122, 41, 0.9) 0%,
        rgba(45, 99, 32, 0.9) 100%
    ) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 25px !important;
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    width: 100% !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
}

.mobile-user-panel .mobile-menu-section .btn.btn-success:hover,
.mobile-user-panel .mobile-menu-section .btn.btn-outline-light:hover,
.mobile-user-panel .mobile-menu-section .btn.btn-success:focus,
.mobile-user-panel .mobile-menu-section .btn.btn-outline-light:focus {
    background: linear-gradient(
        135deg,
        rgba(56, 122, 41, 1) 0%,
        rgba(45, 99, 32, 1) 100%
    ) !important;
    transform: translateY(-2px) !important;
}

/* Ensure unauthenticated button section has same horizontal padding as search */
.mobile-user-panel .mobile-menu-section.text-center {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

/* ===== ENHANCED HAMBURGER MENU - MATCHES CARD DESIGN SYSTEM ===== */
/* Enhanced hamburger menu icon - better visibility and touch targets */
/* IMPORTANT: Only apply enhanced styling on mobile/tablet screens */
@media (max-width: 991.98px) {
    .navbar-toggler {
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 8px !important;
        padding: 0.5rem !important;
        width: 48px !important;
        height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease !important;
        background: rgba(255, 255, 255, 0.05) !important;

        /* CRITICAL: Samsung Browser & Edge Mobile Fixes */
        touch-action: manipulation !important; /* Prevents double-tap zoom conflicts - ENABLED for better mobile UX */
        pointer-events: auto !important; /* Ensures clickability */
        position: relative !important; /* Establishes stacking context */
        z-index: 1050 !important; /* Above other elements */
        cursor: pointer !important; /* Clear interaction intent */
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2) !important; /* Visual feedback */

        /* SAFARI iOS SPECIFIC ENHANCEMENTS */
        -webkit-touch-callout: none !important; /* Disable Safari callout menu */
        -webkit-user-select: none !important; /* Prevent text selection */
        user-select: none !important; /* Standard property */
        -webkit-appearance: none !important; /* Remove default button styling */
        appearance: none !important; /* Standard property for compatibility */
        transform: translateZ(0) !important; /* Hardware acceleration */
        -webkit-transform: translateZ(0) !important; /* WebKit hardware acceleration */
        will-change: transform !important; /* Optimize for animations */
    }
}

/* Hamburger menu hover and active states - only on mobile/tablet */
@media (max-width: 991.98px) {
    .navbar-toggler:hover,
    .navbar-toggler:focus {
        border-color: rgba(255, 255, 255, 0.6) !important;
        background-color: rgba(255, 255, 255, 0.15) !important;
        transform: scale(1.05) !important;
        outline: none !important;
        /* Enhanced Samsung Browser compatibility */
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3) !important;
    }

    .navbar-toggler:active {
        transform: scale(0.95) !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        /* Immediate visual feedback for Samsung Browser */
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.4) !important;
    }
}

/* Hamburger menu icon styling - only on mobile/tablet */
@media (max-width: 991.98px) {
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
        width: 24px !important;
        height: 24px !important;
        /* Samsung Browser specific fixes */
        pointer-events: none !important; /* Prevent icon from intercepting clicks */
        position: relative !important;
        z-index: 1 !important;
    }
}

/* CRITICAL FIX: Ensure hamburger menu is hidden on desktop screens */
@media (min-width: 992px) {
    .navbar-expand-lg .navbar-toggler {
        display: none !important;
    }
}

/* ===== MOBILE Z-INDEX FIXES FOR NAVBAR BUTTON INTERACTIONS ===== */
@media (max-width: 991.98px) {
    /* Ensure hamburger button is above feedback popup and dropdowns */
    .navbar-toggler {
        z-index: 1051 !important; /* Above navbar (1050) and dropdowns (1040) */
        position: relative !important;
    }

    /* Ensure all navbar interactive elements are clickable */
    .navbar-nav .nav-link,
    .mail-icon,
    .user-account-toggle {
        z-index: 1051 !important;
        position: relative !important;
    }

    /* Ensure navbar brand/logo is also clickable */
    .navbar-brand {
        z-index: 1051 !important;
        position: relative !important;
    }
}