/* ===== MOBILE MENU BUTTON CSS ===== */
/* UI/UX Friendly Phone Screen Styling */

/* Base mobile menu button styles */
#mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    background: linear-gradient(135deg, #2b8f41 0%, #1e6b32 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(43, 143, 65, 0.3),
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#mobile-menu-btn:hover {
    background: linear-gradient(135deg, #1e6b32 0%, #2b8f41 100%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(43, 143, 65, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#mobile-menu-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 2px 8px rgba(43, 143, 65, 0.3),
        0 1px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#mobile-menu-btn:focus {
    outline: none;
    box-shadow: 
        0 4px 16px rgba(43, 143, 65, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 0 0 3px rgba(43, 143, 65, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Phone screens (320px - 480px) */
@media (max-width: 480px) {
    #mobile-menu-btn {
        display: block;
        top: 0.75rem;
        right: 0.75rem;
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
}

/* Small phones (320px - 375px) */
@media (max-width: 375px) {
    #mobile-menu-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.8rem;
    }
}

/* Medium phones (376px - 480px) */
@media (min-width: 376px) and (max-width: 480px) {
    #mobile-menu-btn {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.1rem;
        height: 2.1rem;
        font-size: 0.95rem;
    }
}

/* Large phones (481px - 576px) */
@media (min-width: 481px) and (max-width: 576px) {
    #mobile-menu-btn {
        display: block;
        top: 1rem;
        right: 1rem;
        width: 2.3rem;
        height: 2.3rem;
        font-size: 1rem;
    }
}

/* Tablet portrait (577px - 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    #mobile-menu-btn {
        display: block;
        top: 1.25rem;
        right: 1.25rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.1rem;
    }
}

/* Hide on larger screens */
@media (min-width: 769px) {
    #mobile-menu-btn {
        display: none;
    }
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(43, 143, 65, 0.1) 100%);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    animation: fadeInOverlay 0.4s ease-out;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Mobile navigation menu */
.navbar.mobile-active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, rgba(43, 143, 65, 0.95) 0%, rgba(30, 107, 50, 0.98) 100%);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

.navbar.mobile-active {
    transform: translateX(0);
    animation: slideInMenu 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInMenu {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.navbar.mobile-active ul {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    list-style: none;
    padding: 2rem;
    margin: 0;
    width: 100%;
    max-width: 400px;
}

.navbar.mobile-active ul li {
    margin: 0;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.navbar.mobile-active ul li:nth-child(1) { animation-delay: 0.1s; }
.navbar.mobile-active ul li:nth-child(2) { animation-delay: 0.2s; }
.navbar.mobile-active ul li:nth-child(3) { animation-delay: 0.3s; }
.navbar.mobile-active ul li:nth-child(4) { animation-delay: 0.4s; }
.navbar.mobile-active ul li:nth-child(5) { animation-delay: 0.5s; }
.navbar.mobile-active ul li:nth-child(6) { animation-delay: 0.6s; }
.navbar.mobile-active ul li:nth-child(7) { animation-delay: 0.7s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.navbar.mobile-active ul li a {
    font-size: 15px;
    font-weight: 600;
    padding: 1.2rem 2rem;
    display: block;
    color: #ffffff;
    text-decoration: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.navbar.mobile-active 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.2), transparent);
    transition: left 0.5s ease;
}

.navbar.mobile-active ul li a:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.navbar.mobile-active ul li a:hover::before {
    left: 100%;
}

.navbar.mobile-active ul li a:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Close button for mobile menu */
.navbar.mobile-active .close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.navbar.mobile-active .close-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    transform: scale(1.1) rotate(90deg);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.navbar.mobile-active .close-btn:active {
    transform: scale(0.95) rotate(90deg);
}

/* Phone-specific adjustments */
@media (max-width: 480px) {
    .navbar.mobile-active ul li a {
        font-size: 1.3rem;
        padding: 0.8rem 1.5rem;
    }
    
    .navbar.mobile-active .close-btn {
        top: 0.75rem;
        right: 0.75rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}

@media (max-width: 375px) {
    .navbar.mobile-active ul li a {
        font-size: 1.2rem;
        padding: 0.7rem 1.2rem;
    }
    
    .navbar.mobile-active .close-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.1rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    #mobile-menu-btn {
        width: 2.8rem;
        height: 2.8rem;
        font-size: 1.2rem;
    }
    
    .navbar.mobile-active ul li a {
        padding: 1.2rem 2rem;
        font-size: 1.6rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #mobile-menu-btn {
        border-width: 1px;
    }
    
    .navbar.mobile-active ul li a {
        border-width: 0.5px;
    }
}

/* Additional UI/UX Enhancements */

/* Ripple effect for mobile menu button */
#mobile-menu-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#mobile-menu-btn:active::after {
    width: 100%;
    height: 100%;
}

/* Loading state for menu button */
#mobile-menu-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

#mobile-menu-btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Menu item icons (if needed) */
.navbar.mobile-active ul li a i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Active menu item */
.navbar.mobile-active ul li a.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Menu header/title */
.navbar.mobile-active .menu-header {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.9;
    text-align: center;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Focus management for accessibility */
.navbar.mobile-active:focus-within {
    outline: none;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #mobile-menu-btn,
    .navbar.mobile-active,
    .mobile-menu-overlay,
    .navbar.mobile-active ul li a {
        transition: none;
        animation: none;
    }
    
    .navbar.mobile-active ul li {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #mobile-menu-btn {
        background: linear-gradient(135deg, #1a5d2e 0%, #0f3d1f 100%);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .navbar.mobile-active {
        background: linear-gradient(135deg, rgba(26, 93, 46, 0.95) 0%, rgba(15, 61, 31, 0.98) 100%);
    }
}
