/**
 * Modern Mobile Navbar Design v2.2
 * Solid Light Theme Drawer - Dark Mode Removed
 */

@media (max-width: 768px) {

  /* CRITICAL: Prevent horizontal scroll */
  body,
  html {
    overflow-x: hidden !important;
    width: 100%;
    position: relative;
    max-width: 100vw;
  }

  /* Navbar Styling - Solid White */
  nav.mobile-navbar-modern {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(229, 231, 235, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }
}

/* ============================================
   ANIMATED HAMBURGER
   ============================================ */
@media (max-width: 768px) {
  .mobile-menu-btn-modern {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
  }

  /* Hamburger icon container */
  .hamburger-icon {
    position: relative;
    width: 24px;
    height: auto;
    /* Allow auto height for margins */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center visually */
    gap: 5px;
    /* Explicit gap between lines */
  }

  /* Hamburger lines - Pure Black */
  .hamburger-icon span {
    display: block !important;
    width: 24px !important;
    /* Fixed pixel width */
    height: 3px !important;
    /* Fixed thick height */
    background-color: #000000 !important;
    /* Pure Black */
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative !important;
    /* Changed from static to relative */
    opacity: 1 !important;
    flex-shrink: 0;
  }

  /* Active State (Red X) */
  .mobile-menu-btn-modern.active .hamburger-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background: #ef4444 !important;
  }

  .mobile-menu-btn-modern.active .hamburger-icon span:nth-child(2) {
    opacity: 0 !important;
  }

  .mobile-menu-btn-modern.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background: #ef4444 !important;
  }
}

/* ============================================
   SOLID DRAWER CONTAINER
   ============================================ */
@media (max-width: 768px) {
  .mobile-menu-slide {
    position: fixed !important;
    top: 0 !important;
    left: auto !important;
    /* Force detach from left */
    right: 0 !important;
    bottom: 0 !important;
    width: 300px;
    height: 100vh !important;

    /* LIGHT THEME FORCED */
    background: #ffffff !important;
    color: #1f2937;

    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999 !important;
    overflow-y: auto;
    display: block !important;
    visibility: hidden;
  }

  .mobile-menu-slide.show {
    transform: translateX(0) !important;
    visibility: visible !important;
  }

  .mobile-menu-slide.hidden {
    transform: translateX(100%) !important;
    visibility: hidden !important;
  }

  .mobile-menu-slide .mobile-menu-content {
    padding: 80px 0 32px 0;
    min-height: 100vh;
    background: transparent !important;
  }
}

/* ============================================
   MENU ITEMS
   ============================================ */
@media (max-width: 768px) {
  .mobile-menu-slide .mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    min-height: 52px;

    /* Transparent BG */
    background-color: transparent !important;
    background: transparent !important;

    font-size: 16px;
    font-weight: 500;
    color: #374151 !important;
    /* dark gray text */
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;

    transition: background-color 0.2s;
  }

  /* Hover */
  .mobile-menu-slide .mobile-menu-item:hover {
    background-color: #f3f4f6 !important;
    /* light gray hover */
  }

  /* Icons */
  .mobile-menu-slide .mobile-menu-item i {
    width: 24px;
    text-align: center;
    color: #6b7280 !important;
  }

  .mobile-menu-slide .mobile-menu-item:hover i {
    color: #16a34a !important;
  }

  /* Primary CTA (Sign Up) */
  .mobile-menu-slide .mobile-menu-item-primary {
    background-color: #16a34a !important;
    color: #ffffff !important;
    margin: 16px 20px;
    width: auto;
    max-width: calc(100% - 40px);
    border-radius: 8px;
    justify-content: center;
    border: none;
    box-sizing: border-box;
  }

  .mobile-menu-slide .mobile-menu-item-primary:hover {
    background-color: #15803d !important;
  }

  .mobile-menu-slide .mobile-menu-item-primary i {
    color: #ffffff !important;
  }

  /* Logout */
  .mobile-menu-slide .mobile-menu-item-logout {
    color: #ef4444 !important;
  }

  .mobile-menu-slide .mobile-menu-item-logout i {
    color: #ef4444 !important;
  }
}

/* ============================================
   BACKDROP & DESKTOP RESET
   ============================================ */
@media (max-width: 768px) {
  .mobile-menu-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
  }

  .mobile-menu-backdrop.show {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

@media (min-width: 769px) {

  .mobile-menu-btn-modern,
  .mobile-menu-slide,
  .mobile-menu-backdrop {
    display: none !important;
  }
}