/* 
 * Mobile Menu Independent Styles
 * Ensures complete isolation from desktop views
 */

/* 1. Global Hiding for Desktop (Screens > 768px) */
@media (min-width: 769px) {
    .mobile-nav-panel, 
    .menu-overlay,
    .hamburger-wrapper {
        display: none !important;
    }
}

/* 2. Mobile Specific Styles (Screens <= 768px) */
@media (max-width: 768px) {
    
    /* Ensure hamburger is visible */
    .hamburger-wrapper {
        display: flex !important;
    }

    /* Main Panel */
    .mobile-nav-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 300px; /* Standard premium drawer width */
        height: 100vh;
        background: #4e6476;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        /* box-shadow: 25px 0 50px rgba(0, 0, 0, 0.4); */
        padding: 0;
        margin: 0;
    }

    .mobile-nav-panel.active {
        transform: translateX(0);
    }

    /* Header: Logo and Close Button */
    .mobile-menu-header {
        padding: 30px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-menu-header .logo img {
        height: 32px;
        width: auto;
    }

    .mobile-menu-header .logo a {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Close Button Styling */
    .menu-close-wrapper {
       position: absolute;
       top: 30px;
       right: 20px;
    }

    .menu_close {
        position: relative;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, 0.2);
        transition: all 0.3s ease;
    }

    .menu_close:hover {
        background: #f99417;
        border-color: #f99417;
        transform: rotate(180deg);
    }

    /*logo */
    .mobile-menu-header .logo {
       order: 1;
    }
    /* The "X" Icon */
    .menu_close:before,
    .menu_close:after {
        position: absolute;
        content: "";
        height: 14px;
        width: 2px;
        background-color: #fff;
        border-radius: 2px;
    }

    .menu_close:before { transform: rotate(45deg); }
    .menu_close:after { transform: rotate(-45deg); }

    /* Nav Links List */
    .nav-links {
        padding: 30px 0;
        display: flex;
        flex-direction: column;
        gap: 5px;
        flex: 1;
        overflow-y: auto;
    }

    .nav-links a {
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        font-size: 1.1rem;
        font-weight: 500;
        padding: 15px 25px;
        display: flex;
        align-items: center;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0;
        transform: translateX(-20px);
        border: none !important;
    }

    .mobile-nav-panel.active .nav-links a {
        opacity: 1;
        transform: translateX(0);
    }

    /* Staggered Entrance (Opening) */
    .mobile-nav-panel.active .nav-links a:nth-child(1) { transition-delay: 0.1s; }
    .mobile-nav-panel.active .nav-links a:nth-child(2) { transition-delay: 0.2s; }
    .mobile-nav-panel.active .nav-links a:nth-child(3) { transition-delay: 0.3s; }
    .mobile-nav-panel.active .nav-links a:nth-child(4) { transition-delay: 0.4s; }

    /* Exit Stagger (Closing) */
    .mobile-nav-panel:not(.active) .nav-links a:nth-child(4) { transition-delay: 0.0s; }
    .mobile-nav-panel:not(.active) .nav-links a:nth-child(3) { transition-delay: 0.1s; }
    .mobile-nav-panel:not(.active) .nav-links a:nth-child(2) { transition-delay: 0.2s; }
    .mobile-nav-panel:not(.active) .nav-links a:nth-child(1) { transition-delay: 0.3s; }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.05);
        color: #f99417;
        padding-left: 35px;
    }

    .menu-icon {
        margin-right: 15px;
        color: #f99417;
        stroke-width: 2px;
    }

    /* Footer: Social Icons and Copyright */
    .mobile-menu-footer {
        padding: 30px 25px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        background: rgba(0, 0, 0, 0.1);
    }

    .social-links {
        display: flex;
        gap: 12px;
        margin-bottom: 20px;
    }

    .social-icon {
        width: 42px;
        height: 42px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        transition: all 0.3s ease;
        text-decoration: none !important;
    }

    .social-icon:hover {
        background: #f99417;
        border-color: #f99417;
        transform: translateY(-3px);
    }

    .copyright {
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.4);
        margin: 0;
    }

    /* Background Overlay */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 9998; /* Just below panel */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.5s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}
