/* ============================================================
   NAVBAR SPECIFIC CSS - Isolated Namespace
   All classes prefixed with 'nav-' to prevent conflicts
   ============================================================ */

/* Wireframe Navbar - Minecraft Style */
.nav-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #b35151;
  border-bottom: 4px solid #000;
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
  z-index: 1000;
  padding: 0;
  margin: 0;
  font-family: "Segoe UI" !important;
  font-size: 14px;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-brand {
  white-space: nowrap;
  flex-shrink: 0;
  display: none;
}

.nav-brand a {
  color: #ffffff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

.nav-brand a:hover {
  text-shadow: 4px 4px 0 rgba(0,0,0,0.4);
}

/* Main Navigation Menu */
.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
  flex: 1;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  display: block;
  padding: 6px 10px;
  color: #000;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  transition: all 0.05s;
  border: 3px solid #000;
  background: #ffa500;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-menu a:hover {
  background: #ffb733;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transform: translate(2px, 2px);
}

.nav-menu a:active {
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  transform: translate(3px, 3px);
}

/* Individual Menu Item Colors */
.nav-menu li:nth-child(1) a {
  background-color: #3498db;
}
.nav-menu li:nth-child(1) a:hover {
  background-color: #2980b9;
}

.nav-menu li:nth-child(2) a {
  background-color: #9b59b6;
}
.nav-menu li:nth-child(2) a:hover {
  background-color: #8e44ad;
}

.nav-menu li:nth-child(3) a {
  background-color: #e74c3c;
}
.nav-menu li:nth-child(3) a:hover {
  background-color: #c0392b;
}

.nav-menu li:nth-child(4) a {
  background-color: #1abc9c;
}
.nav-menu li:nth-child(4) a:hover {
  background-color: #16a085;
}

/* New Feature Buttons */
.nav-menu li:nth-child(6) a {
  background-color: #2ecc71;
}
.nav-menu li:nth-child(6) a:hover {
  background-color: #27ae60;
}

.nav-menu li:nth-child(7) a {
  background-color: #f39c12;
}
.nav-menu li:nth-child(7) a:hover {
  background-color: #d68910;
}

.nav-menu li:nth-child(8) a {
  background-color: #e67e22;
}
.nav-menu li:nth-child(8) a:hover {
  background-color: #d35400;
}

.nav-menu li:nth-child(9) a {
  background-color: #c0392b;
}
.nav-menu li:nth-child(9) a:hover {
  background-color: #a93226;
}

/* Dropdown Menu Styling */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown > a {
  background-color: #9b59b6 !important;
  margin: 0 !important;
}

.nav-dropdown > a:hover {
  background-color: #8e44ad !important;
}

.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff3e0;
  border: 3px solid #000;
  border-top: 3px solid #000;
  list-style: none;
  margin: 4px 0 0 0;
  padding: 6px;
  z-index: 1001;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  min-width: 100%;
  gap: 4px;
}

.nav-dropdown-menu.active {
  display: flex;
}

.nav-dropdown-menu li {
  margin: 0;
  border: none;
}

.nav-dropdown-menu li:first-child {
  margin-top: 0;
}

.nav-dropdown-menu li:last-child {
  margin-bottom: 0;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: #000;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  transition: all 0.05s;
  background: #ffa500;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid #000;
  margin: 0;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.nav-dropdown-menu a:hover {
  background: #ffb733;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  transform: translate(1px, 1px);
}

.nav-dropdown-menu a:active {
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  transform: translate(1px, 1px);
}

/* User Menu Area */
.nav-user {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
  align-items: center;
  position: relative;
  order: 10;
}

.nav-user li {
  margin: 0;
}

.nav-user-menu-btn {
  display: block;
  padding: 6px 10px;
  color: #000;
  font-size: 12px;
  font-weight: 900;
  transition: all 0.05s;
  border: 3px solid #000;
  background: #ffa500;
  cursor: pointer;
  font-family: "Segoe UI" !important;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-user-menu-btn:hover {
  background: #ffb733;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transform: translate(2px, 2px);
}

.nav-user-menu-btn:active {
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  transform: translate(3px, 3px);
}

/* Upcoming Button - Style like Menu Button */
.nav-upcoming-btn {
  display: block;
  padding: 6px 10px;
  color: #000;
  font-size: 12px;
  font-weight: 900;
  transition: all 0.05s;
  border: 3px solid #000;
  background: #ffa500;
  cursor: pointer;
  font-family: "Segoe UI" !important;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 !important;
}

.nav-upcoming-btn:hover {
  background: #ffb733;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transform: translate(2px, 2px);
}

.nav-upcoming-btn:active {
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  transform: translate(3px, 3px);
}

#nav-user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff3e0;
  border: 3px solid #000;
  list-style: none;
  margin: 4px 0 0 0;
  padding: 6px;
  min-width: 150px;
  display: none;
  flex-direction: column;
  z-index: 1001;
  gap: 4px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

#nav-user-menu.open {
  display: flex;
}

#nav-user-menu li {
  margin: 0;
  overflow: visible;
}

#nav-user-menu li#nav-friend-servers-menu-item {
  position: relative;
  display: none;
  overflow: visible;
  min-width: 220px;
}

#nav-user-menu a {
  display: block;
  padding: 8px 12px;
  color: #000;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  transition: all 0.05s;
  border: 2px solid #000;
  background: #ffa500;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#nav-user-menu a:hover {
  background: #ffb733;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  transform: translate(1px, 1px);
}

#nav-user-menu a.nav-logout-link {
  color: #fff;
  background: #df1b14;
  border: 2px solid #000;
}

#nav-user-menu a.nav-logout-link:hover {
  background: #d76461;
}

/* Friend Servers Dropdown */
.nav-friend-servers-list {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  background: #fff3e0 !important;
  border: 3px solid #ff0000 !important;
  list-style: none;
  margin: 4px 0 0 0 !important;
  padding: 8px !important;
  min-width: 220px !important;
  max-height: 400px;
  overflow-y: auto;
  flex-direction: column;
  z-index: 9999 !important;
  gap: 4px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3) !important;
  display: none !important;
}

.nav-friend-servers-list.open {
  display: flex !important;
}

.nav-friend-servers-list button {
  margin: 0;
  padding: 8px 12px;
  background: #2196f3;
  color: #fff;
  border: 2px solid #000;
  border-radius: 0;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  font-family: "Segoe UI" !important;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.nav-friend-servers-list button:hover {
  background: #1976d2;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}

.nav-friend-servers-list .nav-server-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #34495e;
  border: 2px solid #000;
  color: #ecf0f1;
  font-size: 12px;
  font-weight: bold;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  transition: all 0.05s;
}

.nav-friend-servers-list .nav-server-item:hover {
  background: #475569;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  transform: translate(1px, 1px);
}

.nav-friend-servers-list .nav-server-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-friend-servers-list .nav-server-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #000;
  flex-shrink: 0;
}

.nav-friend-servers-list .nav-server-status.online {
  background: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.nav-friend-servers-list .nav-server-status.offline {
  background: #e74c3c;
  box-shadow: 0 0 8px #e74c3c;
}

/* Buttons - Login, SignUp */
.nav-user .nav-btn {
  padding: 6px 10px !important;
  color: #000 !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  transition: all 0.05s !important;
  border: 3px solid #000 !important;
  background: #ffa500 !important;
  cursor: pointer !important;
  font-family: "Segoe UI" !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.nav-user .nav-btn:hover {
  background: #ffb733 !important;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3) !important;
  transform: translate(2px, 2px) !important;
}

.nav-user .nav-btn:active {
  box-shadow: 1px 1px 0 rgba(0,0,0,0.3) !important;
  transform: translate(3px, 3px) !important;
}

.nav-user .nav-btn.nav-login-btn {
  border: 3px solid #000 !important;
  background: #be3737 !important;
  color: #000 !important;
}

.nav-user .nav-btn.nav-signup-btn {
  background: #41a345 !important;
  color: #000 !important;
  border: 3px solid #000 !important;
}

.nav-user .nav-btn.nav-signup-btn:hover {
  background: #ffffff !important;
}

.nav-user .nav-btn.nav-server-btn {
  background: #6b3dfa !important;
  color: #ffffff !important;
  border: 3px solid #000 !important;
  font-size: 13px !important;
  padding: 6px 12px !important;
}

.nav-user .nav-btn.nav-server-btn:hover {
  background: #8b5ffa !important;
}

/* Mobile Menu Toggle Button */
.nav-mobile-menu-btn {
  display: none;
  background: #ffa500;
  border: 3px solid #000;
  color: #000;
  padding: 6px 10px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.05s;
  flex-shrink: 0;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.nav-mobile-menu-btn:hover {
  background: #ffb733;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transform: translate(2px, 2px);
}

/* Responsive - Tablet (768px breakpoint) */
@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-brand {
    order: 1;
    flex-basis: auto;
  }

  .nav-brand a {
    font-size: 16px;
  }

  .nav-mobile-menu-btn {
    display: inline-block;
    order: 2;
  }

  .nav-menu {
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 6px;
    display: none;
    background: #b35151;
    padding: 6px;
    border-top: 4px solid #000;
    margin: 0;
  }

  .nav-menu.mobile-open {
    display: flex;
  }

  .nav-menu a {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #000;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    font-size: 13px;
  }

  .nav-menu a:hover {
    box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    transform: translate(1px, 1px);
  }

  .nav-user {
    order: 4;
    width: 100%;
    flex-direction: column;
    gap: 6px;
    display: none;
    background: #b35151;
    border-top: 4px solid #000;
    position: static;
    padding: 6px;
    margin: 0;
    justify-content: flex-start;
  }

  .nav-user.mobile-open {
    display: flex;
  }

  .nav-user-menu-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: 2px solid #000;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
    margin: 0;
    font-size: 13px;
  }

  .nav-user-menu-btn:hover {
    box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    transform: translate(1px, 1px);
  }

  /* User dropdown menu on mobile */
  #nav-user-menu {
    position: static;
    border: 2px solid #000;
    background: #b35151;
    display: none;
    flex-direction: column;
    width: 100%;
    min-width: none;
    margin: 0;
    padding: 6px;
    gap: 4px;
    box-shadow: none;
  }

  #nav-user-menu.open {
    display: flex;
  }

  #nav-user-menu a {
    padding: 8px 12px;
    font-size: 13px;
    border: 2px solid #000;
  }
}

/* Small Mobile - 480px breakpoint */
@media (max-width: 480px) {
  .nav-container {
    padding: 8px 12px;
  }

  .nav-brand a {
    font-size: 14px;
  }

  .nav-menu a,
  .nav-user-menu-btn,
  .nav-user .nav-btn {
    font-size: 11px;
    padding: 5px 8px;
  }

  #nav-user-menu a {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* Server Status Display */
.nav-server-status-display {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
  order: 10;
}

.nav-server-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background-color: #a19a8b;
  border: 3px solid #000;
  border-radius: 0;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
  font-size: 12px;
  font-weight: 900;
  color: #000;
  white-space: nowrap;
  height: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-server-indicator:hover {
  background: #ffffff;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  transform: translate(2px, 2px);
}

.nav-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #666;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid #000;
}

.nav-server-indicator[data-state="online"] .nav-indicator-dot {
  background-color: #28a745;
}

.nav-server-indicator[data-state="offline"] .nav-indicator-dot {
  background-color: #dc3545;
}

.nav-indicator-text {
  font-size: 12px;
  font-weight: 900;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Friend Servers Menu Toggle */
.nav-friend-servers-toggle {
  display: flex !important;
  cursor: pointer !important;
}

#nav-friend-servers-list {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff3e0;
  border: 4px solid #000;
  border-top: none;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 200px;
  display: none;
  flex-direction: column;
  z-index: 1002;
  gap: 6px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

#nav-friend-servers-list li {
  margin: 0;
}

#nav-friend-servers-list a {
  display: block;
  padding: 8px 12px;
  color: #000;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  transition: all 0.05s;
  border: 2px solid #000;
  background: #7cb342;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff !important;
}

#nav-friend-servers-list a:hover {
  background: #9ccc65;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  transform: translate(1px, 1px);
}

/* Responsive - hide server status on small screens */
@media (max-width: 768px) {
  .nav-server-status-display {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-server-status-display {
    display: none;
  }
}

/* ============================================================
   LOGIN/REGISTER MODAL STYLING - nav- prefixed
   ============================================================ */

.nav-modal {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.nav-modal.active {
  display: flex !important;
}

.nav-modal-content {
  background: #ffffff;
  border: 4px solid #000;
  padding: 30px;
  border-radius: 0;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  position: relative;
}

.nav-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  font-weight: bold;
}

.nav-modal-close:hover {
  color: #cc0000;
}

.nav-modal h2 {
  margin: 0 0 20px 0;
  font-size: 24px;
  font-weight: bold;
  color: #000;
}

.nav-modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.nav-form-group {
  display: flex;
  flex-direction: column;
}

.nav-form-group label {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

.nav-form-group input,
.nav-form-group select {
  padding: 10px;
  border: 2px solid #000;
  font-size: 14px;
  font-family: "Segoe UI" !important;
}

.nav-form-group input:focus,
.nav-form-group select:focus {
  outline: none;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.nav-submit-btn {
  padding: 12px 20px;
  background: #4CAF50;
  color: #fff;
  border: 2px solid #000;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.nav-submit-btn:hover {
  background: #45a049;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  transform: translate(2px, 2px);
}

.nav-modal-switch {
  background: none;
  border: none;
  color: #0066cc;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.nav-modal-switch:hover {
  color: #0052a3;
}

.nav-modal-error {
  background-color: #f8d7da;
  border: 2px solid #f5c6cb;
  color: #721c24;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
}
