/* mobile-nav.css — Trading Hub v2 mobile navigation & search overlay */
/* Classes prefixed .thv2- or .mob- per project rules */
/* Design tokens: --bg:#06090F --gold:#D4A853 --accent:#4CC2FF --text:#E8EDF5 */

/* ─── 1. Mobile Header ─────────────────────────────────────────────────────── */

.thv2-mobile-header {
  display: none;
}

@media (max-width: 767px) {
  .thv2-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 800;
    background: rgba(6, 9, 15, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .thv2-mobile-header h1 {
    font-size: 16px;
    font-weight: 700;
    color: #E8EDF5;
    margin: 0;
  }

  .thv2-mobile-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #E8EDF5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease;
  }

  .thv2-mobile-btn:hover,
  .thv2-mobile-btn:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    outline: 2px solid rgba(76, 194, 255, 0.4);
    outline-offset: 2px;
  }

  .thv2-mobile-btn:active {
    background: rgba(255, 255, 255, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .thv2-mobile-btn {
    transition: none;
  }
}

/* ─── 2. Ticker Search Overlay ──────────────────────────────────────────────── */

.thv2-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9500;
  display: none;
  flex-direction: column;
  padding: 16px;
}

.thv2-search-overlay.open {
  display: flex;
  animation: thv2-overlay-in 180ms ease;
}

@keyframes thv2-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thv2-search-overlay.open {
    animation: none;
  }
}

.thv2-search-input-wrap {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  transition: border-color 150ms ease;
}

.thv2-search-input-wrap:focus-within {
  border-color: rgba(76, 194, 255, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .thv2-search-input-wrap {
    transition: none;
  }
}

.thv2-search-input {
  background: none;
  border: none;
  color: #E8EDF5;
  font-size: 16px;
  width: 100%;
  outline: none;
}

.thv2-search-input::placeholder {
  color: rgba(232, 237, 245, 0.35);
}

.thv2-search-results {
  flex: 1;
  overflow-y: auto;
  /* Smooth momentum scroll on iOS */
  -webkit-overflow-scrolling: touch;
}

.thv2-search-result-item {
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 100ms ease;
}

.thv2-search-result-item:hover,
.thv2-search-result-item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.thv2-search-result-item:active {
  background: rgba(255, 255, 255, 0.11);
}

@media (prefers-reduced-motion: reduce) {
  .thv2-search-result-item {
    transition: none;
  }
}

/* ─── 3. Bottom Navigation Tabs ─────────────────────────────────────────────── */

.thv2-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .thv2-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(8, 11, 18, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    z-index: 900;
    align-items: stretch;
    /* Safe area inset for phones with home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .thv2-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 500;
    color: #4A5568;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 150ms ease;
    /* Prevent tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
  }

  .thv2-bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.5;
  }

  .thv2-bottom-nav-item.active {
    color: #D4A853;
  }

  .thv2-bottom-nav-item:hover:not(.active) {
    color: rgba(232, 237, 245, 0.6);
  }

  .thv2-bottom-nav-item:focus-visible {
    outline: 2px solid rgba(76, 194, 255, 0.5);
    outline-offset: -2px;
    border-radius: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thv2-bottom-nav-item {
    transition: none;
  }
}

/* Active indicator dot above icon */
@media (max-width: 767px) {
  .thv2-bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 32px;
    height: 2px;
    background: #D4A853;
    border-radius: 0 0 2px 2px;
  }

  .thv2-bottom-nav-item {
    position: relative;
  }
}

/* ─── 4. Swipe Back Gesture Area ─────────────────────────────────────────────── */

.thv2-swipe-back {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 20px;
  z-index: 800;
  /* Invisible tap/drag target — no background */
  pointer-events: auto;
}
