/* ================================================================
   Topcityvibe Pro — Header, Ticker, Nav, Mobile Menu
   v2.1 — Professional mobile header with dark/light toggle
================================================================ */

/* ── Search Overlay ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(5,46,22,.97);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-overlay__inner { width: 100%; max-width: 680px; padding: 0 24px; }
.search-overlay__hint { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--green-light); margin-bottom: 20px; opacity: .7; }
.search-overlay__form { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--green); padding-bottom: 14px; margin-bottom: 28px; }
.search-overlay__icon { color: var(--green-light); font-size: 20px; flex-shrink: 0; }
.search-overlay__input { flex: 1; background: none; border: none; outline: none; color: #fff; font-family: var(--f-disp); font-size: 28px; font-weight: 700; min-width: 0; }
.search-overlay__input::placeholder { color: rgba(255,255,255,.25); }
.search-overlay__close { position: absolute; top: 24px; right: 24px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all var(--ease); cursor: pointer; }
.search-overlay__close:hover { background: var(--green); color: #fff; border-color: var(--green); }
.search-results { display: flex; flex-direction: column; gap: 0; }
.search-result-group { margin-bottom: 18px; }
.search-result-label { font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--green-light); opacity: .6; margin-bottom: 10px; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); margin-bottom: 6px; cursor: pointer; transition: background var(--ease); text-decoration: none; }
.search-result-item:hover { background: rgba(22,163,74,.18); border-color: rgba(22,163,74,.3); }
.search-result-item__icon { width: 36px; height: 36px; border-radius: var(--r-sm); background: rgba(22,163,74,.2); display: flex; align-items: center; justify-content: center; color: var(--green-light); font-size: 14px; flex-shrink: 0; }
.search-result-item__title { font-size: 14px; font-weight: 600; color: #fff; }
.search-result-item__sub { font-size: 11px; color: rgba(255,255,255,.4); }
.search-esc { margin-top: 22px; font-size: 12px; color: rgba(255,255,255,.3); text-align: center; }
.search-esc kbd { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 4px; padding: 2px 7px; font-size: 11px; color: rgba(255,255,255,.5); }

/* ── Breaking News Ticker ── */
.ticker {
  background: var(--green-deep);
  height: 34px;
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
}
.ticker__label {
  flex-shrink: 0;
  background: var(--green);
  color: #fff;
  font-family: var(--f-disp);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.ticker__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-light); animation: blink 1.4s ease infinite; }
.ticker__track { flex: 1; overflow: hidden; min-width: 0; }
.ticker__inner { display: flex; gap: 60px; white-space: nowrap; animation: scroll-t 38s linear infinite; }
.ticker__inner:hover { animation-play-state: paused; }
.ticker__item { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.72); display: inline-flex; align-items: center; gap: 10px; }
.ticker__item::before { content: '◆'; color: var(--green); font-size: 7px; }
.ticker__item a { color: rgba(255,255,255,.82); }
.ticker__item a:hover { color: var(--green-light); }

/* ════════════════════════════════════════════════
   DESKTOP SITE HEADER
════════════════════════════════════════════════ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0; left: 0; right: 0; width: 100%;
  z-index: 1000;
  box-shadow: var(--sh-sm);
  transition: background .3s ease, box-shadow .3s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}

/* ── Logo ── */
.logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 1; min-width: 0;
  text-decoration: none; overflow: hidden;
}
.logo__icon {
  width: 44px; height: 44px; min-width: 44px;
  background: var(--green);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
  box-shadow: var(--sh-g);
  flex-shrink: 0;
}
.logo img { height: 44px; width: auto; max-width: none; }
.logo__text { display: flex; flex-direction: column; line-height: 1; min-width: 0; overflow: hidden; }
.logo__name {
  font-family: var(--f-disp); font-size: 21px; font-weight: 800;
  color: var(--text); letter-spacing: -.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logo__name span { color: var(--green); }
.logo__sub {
  font-size: 9px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
  margin-top: 3px; white-space: nowrap;
}

/* ── Header Actions (desktop) ── */
.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.btn-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all var(--ease);
  cursor: pointer; flex-shrink: 0;
}
.btn-icon:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn-icon.active { background: var(--green); color: #fff; border-color: var(--green); }

/* Desktop dark mode toggle — pill style */
#darkToggle {
  position: relative;
  width: 56px; height: 30px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease;
  overflow: hidden;
  padding: 0;
  display: flex; align-items: center;
}
#darkToggle::before {
  content: '☀️';
  position: absolute; left: 5px;
  font-size: 12px; line-height: 1;
  transition: opacity .3s;
}
#darkToggle::after {
  content: '🌙';
  position: absolute; right: 5px;
  font-size: 11px; line-height: 1;
  opacity: 0;
  transition: opacity .3s;
}
#darkToggle .toggle-knob {
  position: absolute;
  left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 1;
}
body.dark #darkToggle { background: var(--green-deep); border-color: var(--green); }
body.dark #darkToggle::before { opacity: 0; }
body.dark #darkToggle::after { opacity: 1; }
body.dark #darkToggle .toggle-knob { transform: translateX(26px); background: var(--green-light); }

/* ── Hamburger (hidden on desktop) ── */
.btn-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.btn-menu span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all .25s;
}

/* ── Nav Bar (desktop) ── */
.nav-bar {
  background: var(--white);
  border-bottom: 2px solid var(--green);
  position: sticky; top: 64px;
  left: 0; right: 0; width: 100%; z-index: 999;
}
.nav-inner {
  display: flex; align-items: center;
  height: 46px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-item { flex-shrink: 0; height: 100%; display: flex; align-items: center; position: relative; }
.nav-link { display: flex; align-items: center; gap: 5px; padding: 0 16px; height: 100%; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; position: relative; transition: color var(--ease); }
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background: var(--green); transition: width var(--ease); }
.nav-link:hover { color: var(--text); }
.nav-link:hover::after, .nav-item.active .nav-link::after { width: 100%; }
.nav-item.active .nav-link { color: var(--green); font-weight: 800; }
.nav-sep { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.nav-inner .menu { display: flex; align-items: center; height: 100%; list-style: none; margin: 0; padding: 0; }
.nav-inner .menu-item { flex-shrink: 0; height: 100%; display: flex; align-items: center; }
.nav-inner .menu-item > a { display: flex; align-items: center; gap: 5px; padding: 0 16px; height: 100%; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; position: relative; transition: color var(--ease); text-decoration: none; }
.nav-inner .menu-item > a::after { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background: var(--green); transition: width var(--ease); }
.nav-inner .menu-item > a:hover, .nav-inner .menu-item.current-menu-item > a { color: var(--green); font-weight: 800; }
.nav-inner .menu-item > a:hover::after, .nav-inner .menu-item.current-menu-item > a::after { width: 100%; }

/* ════════════════════════════════════════════════
   MOBILE HEADER REDESIGN (≤768px)
   Glassmorphism top bar + Bottom navigation dock
════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Hide desktop elements ── */
  .btn-menu { display: none; }
  .logo__sub { display: none; }

  /* ── Top header bar ── */
  .site-header {
    height: 56px;
    background: var(--white);
    border-bottom: none;
    box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0,0,0,.06);
  }
  body.dark .site-header {
    background: var(--dm-surface);
    box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 12px rgba(0,0,0,.3);
  }

  .header-inner { height: 56px; padding: 0 4px; gap: 8px; }

  .logo { gap: 10px; }
  .logo__icon {
    width: 38px; height: 38px; min-width: 38px;
    font-size: 16px; border-radius: 10px;
  }
  .logo__name { font-size: 18px; }

  /* ── Mobile top-right actions: search + dark toggle ── */
  .header-actions { gap: 6px; }

  /* Keep search and dark toggle visible; hide bell */
  .header-actions .btn-icon { width: 36px; height: 36px; font-size: 14px; }
  .header-actions .btn-icon[aria-label*="Notif"] { display: none; }
  .header-actions .btn-icon[aria-label*="menu"],
  .header-actions .btn-menu { display: none !important; }

  /* Mobile dark toggle — compact icon-only style */
  #darkToggle {
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    overflow: visible;
  }
  #darkToggle::before {
    content: ''; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0;
    width: 16px; height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316A34A'%3E%3Cpath d='M12 2a1 1 0 0 1 1 1v1a1 1 0 0 1-2 0V3a1 1 0 0 1 1-1zm0 16a1 1 0 0 1 1 1v1a1 1 0 0 1-2 0v-1a1 1 0 0 1 1-1zm8-8a1 1 0 0 1 0 2h-1a1 1 0 0 1 0-2h1zM5 11a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2h1zm11.95-6.364a1 1 0 0 1 0 1.414l-.707.707a1 1 0 1 1-1.414-1.414l.707-.707a1 1 0 0 1 1.414 0zM8.172 15.95a1 1 0 0 1 0 1.414l-.707.707a1 1 0 1 1-1.414-1.414l.707-.707a1 1 0 0 1 1.414 0zm9.9 1.414a1 1 0 0 1-1.414 0l-.707-.707a1 1 0 0 1 1.414-1.414l.707.707a1 1 0 0 1 0 1.414zM6.757 6.757a1 1 0 0 1-1.414 0l-.707-.707a1 1 0 0 1 1.414-1.414l.707.707a1 1 0 0 1 0 1.414zM12 7a5 5 0 1 0 0 10A5 5 0 0 0 12 7z'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 1;
    border-radius: 0;
    background-color: transparent;
  }
  #darkToggle::after {
    content: ''; right: auto; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0;
    width: 15px; height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2386EFAC'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E") center/contain no-repeat;
    background-color: transparent;
    border-radius: 0;
  }
  body.dark #darkToggle::after { opacity: 1; }
  body.dark #darkToggle::before { opacity: 0; }
  #darkToggle .toggle-knob { display: none; }
  body.dark #darkToggle { background: rgba(22,163,74,.15); border-color: var(--green); }

  /* ── Nav bar stays below header ── */
  .nav-bar { top: 56px; }

  /* ════════════════════════════════
     BOTTOM NAVIGATION DOCK
  ════════════════════════════════ */
  .mob-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 62px;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0,0,0,.10);
    z-index: 1500;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.dark .mob-bottom-nav {
    background: var(--dm-surface);
    border-top-color: rgba(255,255,255,.06);
    box-shadow: 0 -4px 24px rgba(0,0,0,.4);
  }

  .mob-nav-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; flex: 1; height: 100%;
    cursor: pointer; position: relative;
    text-decoration: none;
    color: var(--text-muted);
    transition: color .2s ease;
    -webkit-tap-highlight-color: transparent;
    font-size: 10px; font-weight: 600;
    letter-spacing: .3px;
    border: none; background: none; padding: 0;
  }
  .mob-nav-item.active { color: var(--green); }
  .mob-nav-item i {
    font-size: 18px;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
  }
  .mob-nav-item.active i { transform: scale(1.15); }
  .mob-nav-item span { font-size: 9.5px; font-weight: 700; letter-spacing: .2px; }

  /* Active dot indicator */
  .mob-nav-item.active::after {
    content: '';
    position: absolute; top: 6px;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--green);
    animation: navDotIn .3s cubic-bezier(.34,1.56,.64,1) both;
  }

  /* Center FAB — hamburger menu */
  .mob-nav-item.mob-menu-fab {
    width: 50px; height: 50px; flex: 0 0 50px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    margin-top: -20px;
    box-shadow: 0 4px 18px rgba(22,163,74,.45);
    border: 3px solid var(--white);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  }
  body.dark .mob-nav-item.mob-menu-fab { border-color: var(--dm-surface); }
  .mob-nav-item.mob-menu-fab i { font-size: 20px; }
  .mob-nav-item.mob-menu-fab span { display: none; }
  .mob-nav-item.mob-menu-fab:active { transform: scale(.92); }
  .mob-nav-item.mob-menu-fab::after { display: none; }

  /* Ripple effect on tap */
  .mob-nav-item::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--green);
    opacity: 0;
    transform: scale(0);
    transition: opacity .3s, transform .3s;
  }
  .mob-nav-item:active::before { opacity: .12; transform: scale(1); }

  /* Body padding so content isn't hidden behind bottom nav */
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

  /* ════════════════════════════════
     SLIDE-UP FULL-SCREEN MENU
  ════════════════════════════════ */
  .mob-menu {
    display: flex; flex-direction: column;
    position: fixed; inset: 0;
    z-index: 2000;
    transform: translateY(100%);
    transition: transform .38s cubic-bezier(.32,.72,0,1);
    background: var(--white);
    border-radius: 24px 24px 0 0;
  }
  body.dark .mob-menu { background: var(--dm-surface); }
  .mob-menu.open { transform: translateY(0); display: flex; }

  /* Pull handle */
  .mob-hdr {
    padding: 12px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    flex-shrink: 0;
    position: relative;
  }
  body.dark .mob-hdr { border-bottom-color: rgba(255,255,255,.07); }
  .mob-hdr::before {
    content: '';
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--border);
  }

  .mob-logo {
    font-family: var(--f-disp); font-size: 22px; font-weight: 800;
    color: var(--text); margin-top: 8px;
    display: block;
  }
  .mob-logo span { color: var(--green); }

  .mob-close {
    position: absolute; top: 16px; right: 16px;
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; cursor: pointer;
  }
  body.dark .mob-close { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.06); color: var(--dm-text); }

  .mob-nav { flex: 1; overflow-y: auto; padding: 8px 0 24px; }

  .mob-link {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 24px;
    font-family: var(--f-disp); font-size: 16px; font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border-2);
    transition: background var(--ease);
    text-decoration: none;
  }
  body.dark .mob-link { border-bottom-color: rgba(255,255,255,.04); color: var(--dm-text); }
  .mob-link:hover, .mob-link:active { background: var(--green-tint); color: var(--green); }
  body.dark .mob-link:hover { background: rgba(22,163,74,.12); }
  .mob-link i { width: 22px; color: var(--green); font-size: 15px; flex-shrink: 0; }

  /* Dark mode toggle inside mobile menu */
  .mob-dark-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-2);
  }
  body.dark .mob-dark-row { border-bottom-color: rgba(255,255,255,.04); }
  .mob-dark-label {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--f-disp); font-size: 15px; font-weight: 700;
    color: var(--text);
  }
  body.dark .mob-dark-label { color: var(--dm-text); }
  .mob-dark-label i { width: 22px; color: var(--green); font-size: 15px; }

  /* iOS-style toggle switch */
  .mob-dark-switch {
    position: relative; width: 52px; height: 30px;
    cursor: pointer; flex-shrink: 0;
  }
  .mob-dark-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
  .mob-dark-switch .switch-track {
    position: absolute; inset: 0;
    background: var(--border);
    border-radius: 99px;
    transition: background .3s ease;
  }
  .mob-dark-switch .switch-knob {
    position: absolute;
    top: 3px; left: 3px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    z-index: 1;
  }
  .mob-dark-switch input:checked + .switch-track { background: var(--green); }
  .mob-dark-switch input:checked ~ .switch-knob { transform: translateX(22px); }
}

/* ── Desktop Mobile Menu — hide the bottom nav ── */
@media (min-width: 769px) {
  .mob-bottom-nav { display: none; }
  .mob-menu {
    display: none;
    position: fixed; inset: 0;
    background: var(--white);
    z-index: 2000;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s ease;
  }
  .mob-menu.open { display: flex; transform: translateX(0); }
  .mob-hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--green-deep);
    flex-shrink: 0;
  }
  .mob-logo { font-family: var(--f-disp); font-size: 20px; font-weight: 800; color: #fff; }
  .mob-logo span { color: var(--green-light); }
  .mob-close {
    width: 38px; height: 38px; border-radius: var(--r-sm);
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; flex-shrink: 0;
  }
  .mob-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
  .mob-link {
    display: flex; align-items: center; gap: 14px; padding: 14px 22px;
    font-family: var(--f-disp); font-size: 15px; font-weight: 700; color: var(--text);
    border-bottom: 1px solid var(--border-2);
    transition: background var(--ease); text-decoration: none;
  }
  .mob-link:hover { background: var(--green-tint); color: var(--green); }
  .mob-link i { width: 20px; color: var(--green); font-size: 14px; flex-shrink: 0; }
  .mob-dark-row { display: none; }
  .btn-menu { display: flex; }
}

/* Tablet nav bar top */
@media (max-width: 768px) {
  .header-inner { height: 56px; gap: 8px; }
  .nav-bar { top: 56px; }
  .btn-icon { width: 36px; height: 36px; font-size: 14px; }
}

@keyframes navDotIn {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}
