/* Modern Mobile Menu Styles */

/* Disable old mobile menu system completely */
@media (max-width: 991px) {
  .wsmenu > .wsmenu-list,
  .wsmenu-list,
  .wsmenu > .wsmenu-list > li {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  .wsmenu {
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  .wsactive .wsmenu,
  .wsactive .wsmenu > .wsmenu-list {
    display: none !important;
    visibility: hidden !important;
  }
  
  /* Hide any old mobile menu elements */
  .wsmenu > .wsmenu-list > li > ul.sub-menu,
  .wsmenu > .wsmenu-list > li > .wsmegamenu {
    display: none !important;
  }
}

/* Modern Mobile Menu Container */
.modern-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  pointer-events: auto;
}

/* Overlay */
.mobile-menu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
  cursor: pointer;
}

/* Menu Content Panel */
.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 400px;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease-out;
  overflow-y: auto;
}

/* Menu Header */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.mobile-close-btn {
  background: none;
  border: none;
  padding: 8px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-close-btn:hover {
  background-color: #f3f4f6;
  color: #374151;
}

/* Menu List */
.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.mobile-menu-item {
  border-bottom: 1px solid #f3f4f6;
}

.mobile-menu-item:last-child {
  border-bottom: none;
}

.mobile-menu-item > a {
  display: block;
  padding: 16px 24px;
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-menu-item > a:hover {
  background-color: #f9fafb;
  color: #7f02f7;
  text-decoration: none;
}

/* Submenu Toggle */
.mobile-submenu-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: none;
  border: none;
  color: #374151;
  font-weight: 500;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-submenu-toggle:hover {
  background-color: #f9fafb;
  color: #7f02f7;
}

.mobile-submenu-toggle.active {
  background-color: #f3f4f6;
  color: #7f02f7;
}

.mobile-submenu-toggle .chevron {
  transition: transform 0.2s ease;
  color: #9ca3af;
}

.mobile-submenu-toggle.active .chevron {
  transform: rotate(180deg);
  color: #7f02f7;
}

/* Submenu */
.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  background-color: #f9fafb;
  transition: max-height 0.3s ease;
}

.mobile-submenu.open {
  max-height: 400px;
}

.mobile-submenu li {
  list-style: none;
}

.mobile-submenu a {
  display: block;
  padding: 12px 24px 12px 48px;
  color: #6b7280;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-submenu a:hover {
  background-color: #f3f4f6;
  color: #7f02f7;
  text-decoration: none;
}

.mobile-submenu a:before {
  content: '';
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background-color: #d1d5db;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.mobile-submenu a:hover:before {
  background-color: #7f02f7;
}

/* Call to Action */
.mobile-cta {
  margin-top: auto;
  padding: 24px;
}

.mobile-signin-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #7f02f7 0%, #9333ea 100%);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(127, 2, 247, 0.2);
}

.mobile-signin-btn:hover {
  background: linear-gradient(135deg, #6b01d9 0%, #7c2dd6 100%);
  box-shadow: 0 4px 12px rgba(127, 2, 247, 0.3);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Responsive adjustments */
@media (max-width: 480px) {
  .mobile-menu-content {
    width: 100%;
    max-width: none;
  }
}

/* Hide mobile menu completely on desktop */
@media (min-width: 992px) {
  .modern-mobile-menu,
  .mobile-menu-fullscreen,
  .modern-fullscreen-menu {
    display: none !important;
    visibility: hidden !important;
  }
}

/* Mobile header improvements */
@media (max-width: 991px) {
  .wsmobileheader {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }
  
  .wsanimated-arrow {
    z-index: 99998 !important;
  }
  
  .wsanimated-arrow span,
  .wsanimated-arrow span:before,
  .wsanimated-arrow span:after {
    background: #374151 !important;
    transition: all 0.3s ease !important;
  }
  
  .wsanimated-arrow:hover span,
  .wsanimated-arrow:hover span:before,
  .wsanimated-arrow:hover span:after {
    background: #7f02f7 !important;
  }
  
  /* Perfect X transformation when menu is active */
  .wsactive .wsanimated-arrow span {
    background-color: transparent !important;
  }
  
  .wsactive .wsanimated-arrow span:before {
    transform: rotate(45deg) !important;
    top: 0 !important;
    width: 22px !important;
  }
  
  .wsactive .wsanimated-arrow span:after {
    transform: rotate(-45deg) !important;
    bottom: 0 !important;
    top: 0 !important;
    width: 22px !important;
  }
  
  /* CRITICAL: Prevent header from moving when menu is active */
  .wsactive .wsmobileheader {
    margin-right: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Prevent the main container from moving */
  .wsactive .wsmenucontainer {
    margin-right: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Keep header wrapper fixed */
  .wsactive .header-wrapper {
    margin-right: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Ensure header stays in position */
  .wsactive header {
    margin-right: 0 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Body scroll lock when menu is open */
body.wsactive {
  overflow: hidden !important;
}