/* ===== Responsive Menu - Hamburger Menu ===== */

/* Reset */
.nav-responsive * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.nav-responsive {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: visible;
  max-width: 100vw;
  box-sizing: border-box;
}

/* ===== Top Bar ===== */
.nav-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.2);
  overflow: visible;
  box-sizing: border-box;
  max-width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-logo-text {
  color: white;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  display: inline-block;
}

/* Hamburger Button */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Hamburger Animation */
.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

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

/* ===== Desktop Menu ===== */
.nav-menu {
  display: flex;
  list-style: none !important;
  padding: 0;
  margin: 0;
  overflow: visible !important;
  background: none !important;
  float: none !important;
  flex-wrap: nowrap;
}

.nav-menu li {
  position: relative;
  float: none !important;
}

.nav-menu li a {
  background: transparent;
}

.nav-menu li a {
  display: block;
  padding: 12px 16px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
}

.nav-menu li a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #00d2ff;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  max-width: 90vw;
  background: #0d0d1a !important;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 1001;
}

/* Desktop: hover to show */
.nav-dropdown:hover > .nav-dropdown-content {
  display: block;
}

/* Mobile: click to show */
.nav-dropdown.active > .nav-dropdown-content {
  display: block;
}

.nav-dropdown-content a {
  padding: 10px 16px;
  font-size: 13px;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-dropdown-content a:last-child {
  border-bottom: none;
}

.nav-dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #00d2ff;
}

/* User Info & Logout */
.nav-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-user-info {
  color: #00d2ff;
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(0, 210, 255, 0.1);
  border-radius: 6px;
}

.nav-logout {
  background: #e94560 !important;
  color: white !important;
  padding: 8px 16px !important;
  border-radius: 6px;
  font-weight: 600 !important;
}

.nav-logout:hover {
  background: #c23152 !important;
  transform: scale(1.05);
}

/* ===== Mobile Styles ===== */
@media only screen and (max-width: 768px) {
  .nav-hamburger {
    display: flex;
    flex-shrink: 0;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d0d1a !important;
    flex-direction: column;
    padding: 10px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu li {
    width: 100%;
    box-sizing: border-box;
  }

  .nav-menu li a {
    padding: 14px 16px;
    font-size: 14px;
    color: white;
    background: #0d0d1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: normal !important;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-menu li a:hover {
    background: #1a1a2e !important;
    color: #00d2ff;
  }

  /* Dropdown in mobile - full width */
  .nav-dropdown-content {
    position: static;
    min-width: 100%;
    max-width: 100%;
    background: #0d0d1a;
    border-radius: 0;
    display: none;
    overflow: hidden;
    box-sizing: border-box;
  }

  .nav-dropdown.active .nav-dropdown-content {
    display: block;
  }

  .nav-dropdown-content a {
    padding-left: 32px;
    padding-right: 16px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: normal;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    width: 100%;
  }

  .nav-dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #00d2ff;
  }

  /* User section in mobile */
  .nav-user {
    display: none;
    flex-direction: column;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
  }
  .nav-user.active {
    display: flex;
  }

  .nav-user-info {
    width: 100%;
    text-align: center;
    font-size: 12px;
    word-wrap: break-word;
    overflow: hidden;
    box-sizing: border-box;
  }

  .nav-logout {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

/* ===== Scrollbar ===== */
.nav-menu::-webkit-scrollbar {
  width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.nav-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* ===== Small Mobile (≤400px) ===== */
@media only screen and (max-width: 400px) {
  .nav-topbar {
    padding: 8px 12px;
  }

  .nav-logo-text {
    font-size: 15px;
    max-width: 100px;
  }

  .nav-menu li a {
    padding: 12px 14px;
    font-size: 13px;
  }

  .nav-dropdown-content a {
    padding-left: 28px;
    font-size: 12px;
  }

  .nav-user-info {
    font-size: 11px;
    padding: 6px 10px;
  }
}
