/* ==========================================================================
   Hoppy Navigation Bar Styles
   Shared navigation layout, profile section, dropdowns, mobile hamburger,
   search UI, and mobile menu overlay.
   ========================================================================== */

/* ── Main Nav Layout ── */
.nav {
  background: var(--color-nav-bg);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.15);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

/* ── Brand ── */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-surface);
  font-size: 22px;
  font-weight: 600;
  padding: 16px 0;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.nav-brand:hover { text-decoration: none; }

.nav-brand img {
  height: 36px;
  vertical-align: middle;
}

.nav-brand span {
  background: linear-gradient(135deg, var(--color-accent-light), #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Nav Links (Desktop) ── */
.nav-links-app {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a,
.app-nav-link {
  color: rgba(255,255,255,0.7);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  background: none;
}

.nav-links a:hover,
.app-nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: var(--color-surface);
  text-decoration: none;
}

.nav-links a.active,
.app-nav-link.active {
  background: rgba(255,255,255,0.15);
  color: var(--color-surface);
  text-decoration: none;
}

/* ── Search Wrapper ── */
.search-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

/* ── Nav Dropdowns ── */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
  cursor: pointer;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s;
}

.nav-dropdown-trigger:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--color-nav-bg);
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.1s, transform 0.1s;
}

.nav-dropdown-panel.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.nav-dropdown-panel a {
  display: block;
  padding: 8px 16px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.15s;
}

.nav-dropdown-panel a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.dropdown-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 6px 0;
}

.dropdown-label {
  display: block;
  padding: 4px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
}

/* ── Profile Section ── */
.profile-section {
  display: flex;
  align-items: center;
  position: relative;
}

.profile-section:hover .profile-dropdown {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary, #6c5ce7);
  color: var(--color-surface, #fff);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.profile-avatar:hover { opacity: 0.85; }

.profile-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--color-nav-bg, #1a1a2e);
  border-radius: 0 0 8px 8px;
  padding: 8px 0;
  padding-top: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}

.profile-dropdown.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.profile-dropdown-name {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-surface, #fff);
}

.profile-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.profile-dropdown button:hover {
  background: rgba(255,255,255,0.1);
  color: var(--color-surface, #fff);
}

/* ── Color Mode Toggle ── */
.color-mode-toggle {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.color-mode-toggle:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Search Toggle & Container ── */
.search-toggle {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
  color: var(--color-surface);
}

.search-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.search-container {
  display: none;
  position: relative;
}

.search-container.active {
  display: flex;
  align-items: center;
}

.search-input {
  padding: 8px 14px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--color-surface);
  color: var(--color-text);
  width: 320px;
}

.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--color-shadow);
  z-index: 300;
  margin-top: 4px;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--color-bg);
}

.search-result-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.search-result-snippet {
  font-size: 12px;
  color: var(--color-dim);
}

.search-result-snippet mark {
  background: var(--color-accent-light);
  color: var(--color-text);
  padding: 0 2px;
  border-radius: 2px;
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--color-dim);
  font-size: 13px;
}

/* ── Hamburger (Mobile) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--color-surface);
  font-size: 24px;
  cursor: pointer;
}

.hamburger-app {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.hamburger-app span {
  width: 22px;
  height: 2px;
  background: var(--color-surface);
  margin: 3px 0;
  display: block;
}

/* ── Mobile Search Bar ── */
.mobile-search-bar {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  background: var(--color-nav-bg);
  padding: 8px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 98;
}

.mobile-search-bar.active {
  display: flex;
  align-items: center;
}

.mobile-search-bar .search-input {
  width: 100%;
  flex: 1;
}

.mobile-search-bar .search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  border-radius: 0 0 8px 8px;
}

.mobile-search-close {
  background: none;
  border: none;
  color: var(--color-surface);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 8px;
}

/* Mobile search toggle in nav-right (hidden on desktop) */
.mobile-search-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
  color: var(--color-surface);
}

.mobile-search-toggle:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Mobile Menu Overlay ── */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 60px);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(15px);
  z-index: 99;
  padding: 2rem;
}

.mobile-menu-overlay.active {
  display: block;
}

.mobile-menu-overlay a,
.mobile-menu-overlay button {
  display: block;
  width: 100%;
  text-align: center;
  padding: 1rem;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
}

.mobile-menu-overlay a:hover,
.mobile-menu-overlay button:hover {
  background: var(--color-shadow);
  color: var(--color-primary);
}

/* Mobile dropdown sections */
.mobile-dropdown-trigger {
  display: block;
  width: 100%;
  text-align: center;
  padding: 1rem;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
}

.mobile-dropdown-panel {
  display: none;
  padding: 0 0 8px;
}

.mobile-dropdown-panel.open {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Broadcaster Notice ── */
.broadcaster-notice {
  text-align: center;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 400;
}

.broadcaster-notice.notice-pending {
  background: var(--color-notice-warn-bg);
  color: var(--color-notice-warn-text);
  border-bottom: 1px solid var(--color-notice-warn-border);
}

.broadcaster-notice.notice-revoked {
  background: var(--color-notice-error-bg);
  color: var(--color-notice-error-text);
  border-bottom: 1px solid var(--color-notice-error-border);
}

/* ── Responsive: Mobile Nav ── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }

  .nav-links,
  .nav-links-app {
    display: none !important;
  }

  .nav-links.open { display: flex; }
  .hamburger { display: block; }
  .hamburger-app { display: flex !important; }
  .nav-center { display: none !important; }
  .mobile-search-toggle { display: block; }

  /* Profile section stays visible on mobile */
  .nav-right { display: flex !important; }
  .profile-section { display: flex !important; }
  .profile-avatar { width: 40px; height: 40px; font-size: 18px; min-width: 40px; min-height: 40px; }
  .profile-dropdown { right: 0; left: auto; min-width: 200px; }

  .nav-dropdown-panel { position: static; box-shadow: none; min-width: 0; padding-left: 16px; }
}

@media (min-width: 769px) {
  .hamburger-app { display: none !important; }
  .mobile-search-toggle { display: none !important; }
  .mobile-search-bar { display: none !important; }
}
