/* Complete Navbar Override - No Bulma Dependencies */

/* Reset ALL Bulma navbar styles */
.navbar-menu {
  display: flex !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Custom Mobile Burger - NOT using Bulma classes */
.mobile-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 3.25rem;
  height: 3.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  z-index: 1002;
  position: relative;
}

.mobile-burger span {
  display: block;
  height: 2px;
  width: 18px;
  background-color: #333;
  margin: 3px 0;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Burger animation when active */
.mobile-burger.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-burger.is-active span:nth-child(2) {
  opacity: 0;
}

.mobile-burger.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Styles */
@media screen and (max-width: 1023px) {
  .mobile-burger {
    display: flex !important;
  }

  .navbar-menu {
    position: fixed !important;
    left: -100% !important;
    top: 0 !important;
    width: 65% !important;
    max-width: 300px !important;
    height: 100vh !important;
    background-color: white !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3) !important;
    z-index: 1001 !important;
    overflow-y: auto !important;
    padding-top: 4rem !important;
    transition: left 0.3s ease !important;
    display: block !important;
  }

  .navbar-menu.is-active {
    left: 0 !important;
  }

  /* Backdrop - ONLY covers the remaining 35% */
  .mobile-backdrop {
    position: fixed;
    top: 0;
    left: 65%; /* Start where menu ends */
    width: 35%; /* Only cover remaining area */
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Lower than menu */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none; /* Don't block clicks when hidden */
  }

  .mobile-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Allow clicks when active */
  }

  /* Mobile navbar items - ensure they're clickable */
  .navbar-item {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #f5f5f5 !important;
    position: relative !important;
    z-index: 1002 !important;
    display: block !important;
  }

  .navbar-item a {
    display: block !important;
    width: 100% !important;
    color: #333 !important;
    text-decoration: none !important;
    z-index: 1002 !important;
    position: relative !important;
  }

  /* COMPLETELY DISABLE HOVER BEHAVIORS ON MOBILE */
  .navbar-item.has-dropdown {
    display: block !important;
    position: relative !important;
  }

  /* DISABLE ALL HOVER BEHAVIORS */
  .navbar-item.has-dropdown:hover .navbar-dropdown,
  .navbar-item.has-dropdown.is-hoverable:hover .navbar-dropdown {
    display: none !important; /* Force hide on hover */
  }

  .navbar-item.has-dropdown .navbar-dropdown {
    display: none !important;
    position: static !important;
    background-color: #f8f9fa !important;
    border-left: 3px solid #007bff !important;
    margin-left: 0 !important;
    padding-left: 1rem !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 1002 !important;
    width: 100% !important;
    overflow: hidden !important;
    max-height: 0 !important;
    transition: max-height 0.3s ease !important;
    pointer-events: auto !important; /* Ensure dropdown items are clickable */
  }

  .navbar-item.has-dropdown.is-active .navbar-dropdown {
    display: block !important;
    max-height: 500px !important;
    pointer-events: auto !important;
  }

  /* Dropdown items styling */
  .navbar-dropdown .navbar-item {
    padding: 0.5rem 1rem !important;
    border-bottom: 1px solid #e9ecef !important;
    background-color: transparent !important;
    pointer-events: auto !important;
  }

  .navbar-dropdown .navbar-item:hover {
    background-color: #e9ecef !important;
  }

  .navbar-dropdown .navbar-item a {
    color: #495057 !important;
    padding: 0.25rem 0 !important;
    pointer-events: auto !important;
  }

  .navbar-link {
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    position: relative !important;
    z-index: 1002 !important;
    display: block !important;
    width: 100% !important;
    color: #333 !important;
    text-decoration: none !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: none !important;
    pointer-events: auto !important;
  }

  .navbar-link::after {
    border: 2px solid #007bff !important;
    border-radius: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    content: " " !important;
    display: block !important;
    height: 0.5em !important;
    pointer-events: none !important;
    position: absolute !important;
    right: 1rem !important;
    top: 50% !important;
    transform: rotate(-45deg) !important;
    transform-origin: center !important;
    width: 0.5em !important;
    transition: transform 0.2s ease !important;
  }

  .navbar-item.has-dropdown.is-active .navbar-link::after {
    transform: rotate(135deg) !important;
  }

  /* Ensure navbar brand stays on top */
  .navbar-brand {
    position: relative !important;
    z-index: 1003 !important;
  }

  /* Fix navbar start/end containers */
  .navbar-start,
  .navbar-end {
    display: block !important;
    width: 100% !important;
  }

  /* Prevent any hover interactions */
  .navbar-item.has-dropdown * {
    pointer-events: auto !important;
  }
}

/* Desktop styles - restore hover behavior for desktop only */
@media screen and (min-width: 1024px) {
  .mobile-burger {
    display: none !important;
  }

  .navbar-menu {
    display: flex !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .mobile-backdrop {
    display: none !important;
  }

  /* Restore desktop dropdown behavior with is-hoverable class */
  .navbar-item.has-dropdown.is-hoverable:hover .navbar-dropdown {
    display: block !important;
  }

  .navbar-start {
    display: flex !important;
  }

  .navbar-end {
    display: flex !important;
    margin-left: auto !important;
  }
}