/* EquiSense — Discover Page Styles (page-specific; shared styles in common.css)
   Deep-dive styles split into: deep-dive.css, dd-kavach.css, dd-overview.css, etc. */

/* Discover sections container */
.discover-sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: calc(100vh - 140px);
}

/* Watchlist strip */
.wl-strip {
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

/* Theme card */
.theme-card {
  cursor: pointer; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.2s;
}
.theme-card.active {
  border-color: var(--accent) !important;
  background: var(--green-alt-tint) !important;
}

/* ─── Hero Ticker Scroll ──────────────────────────────────────────────── */
@keyframes heroScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.hero-controls {
  display: flex; justify-content: center; gap: 8px; margin-top: 8px;
}
.hero-ctrl-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--tint-8); border: none; color: var(--text-secondary);
  font-size: 14px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.hero-ctrl-btn:hover { background: var(--tint-12); color: var(--text-primary); }

/* ─── Hero Card: Returns / 52W hover swap ────────────────────────────── */
.hero-pick-card .hero-returns { transition: opacity 0.25s ease; }
.hero-pick-card:hover .hero-returns { opacity: 0; pointer-events: none; }
.hero-pick-card { overflow: visible; }
.hero-pick-card .hero-52w {
  opacity: 0; transition: opacity 0.25s ease;
  position: absolute; top: 0; left: 0; right: 0;
}
.hero-pick-card:hover .hero-52w { opacity: 1; }

/* ─── 52W Range Track ────────────────────────────────────────────────── */
.range-52w-track {
  height: 1.5px; background: var(--border); border-radius: 1px;
  position: relative; margin-top: 6px;
}
.range-52w-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); position: absolute; top: -3px;
  box-shadow: 0 0 6px 2px rgba(52,211,153,0.4);
}
:root[data-theme="light"] .range-52w-dot {
  box-shadow: 0 0 6px 2px rgba(5,150,105,0.35);
}

/* ─── Responsive: Tablet (≤768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
  .discover-sections { gap: 20px; }

  /* Themes — single column: horizontal scroll pills + detail below */
  .themes-grid {
    grid-template-columns: 1fr !important;
  }
  .themes-list {
    flex-direction: row !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .themes-list::-webkit-scrollbar { display: none; }
  .themes-list .theme-card {
    flex-shrink: 0 !important;
    min-width: 180px !important;
  }
  .theme-detail { padding: 16px !important; }
  .tab-btn { font-size: 12px !important; padding: 8px 12px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE (≤480px) — Full redesign for touch-first experience
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* ── Layout ─────────────────────────────────────────────────────────── */
  .discover-sections { gap: 24px; }
  .page-main { padding: 8px 12px 16px !important; }
  .discover-sections h2 { font-size: 18px !important; letter-spacing: -0.02em; }

  /* ── Indices Ticker ─────────────────────────────────────────────────── */
  .indices-ticker-section {
    padding: 6px 0 !important;
    margin: 0 -12px;
    width: calc(100% + 24px);
  }

  /* ── AI-Surfaced Stocks ─────────────────────────────────────────────── */
  .hero-title-row { flex-wrap: wrap !important; gap: 6px !important; }

  /* Cards: show 1.8 cards to invite scroll */
  #hero-picks-scroll {
    margin: 0 -12px !important;
    padding: 0 12px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #hero-picks-scroll::-webkit-scrollbar { display: none; }

  .hero-pick-card {
    min-width: 200px !important;
    max-width: 210px !important;
    padding: 12px 14px 16px !important;
  }
  .hero-pick-card span[style*="font-size:13px"] { font-size: 12px !important; }
  .hero-pick-card span[style*="font-size:15px"] { font-size: 14px !important; }

  /* Controls — bigger touch targets */
  .hero-controls { margin-top: 12px; gap: 12px; }
  .hero-ctrl-btn {
    width: 36px; height: 36px; font-size: 16px;
    background: var(--tint-6);
  }

  /* ── AI-Surfaced Themes ─────────────────────────────────────────────── */
  .themes-grid {
    gap: 10px !important;
  }

  /* Horizontal pill strip */
  .themes-list {
    margin: 0 -12px !important;
    padding: 0 12px 10px !important;
    gap: 6px !important;
  }
  .themes-list .theme-card {
    min-width: auto !important;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    white-space: nowrap;
    font-size: 12px;
  }
  .themes-list .theme-card span[style*="font-size:18px"] {
    font-size: 14px !important;
  }
  .themes-list .theme-card div[style*="font-size:10px"] {
    display: none !important;
  }
  .themes-list .theme-card div[style*="font-size:12px"] {
    font-size: 12px !important;
  }

  /* Theme detail panel */
  .theme-detail {
    padding: 16px !important;
    border-radius: 14px !important;
  }
  .theme-detail h3 { font-size: 16px !important; }
  .theme-detail p[style*="font-size:12px"] { font-size: 12px !important; line-height: 1.5 !important; }
  .theme-detail .grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .theme-detail .stat-box {
    padding: 10px 8px;
    text-align: center;
  }
  .theme-detail .stat-label { font-size: 9px !important; }
  .theme-detail .stat-value { font-size: 15px !important; }

  /* Stock chips in theme — compact, wrap naturally */
  .theme-detail div[style*="flex-wrap"] {
    gap: 6px !important;
  }
  .theme-detail div[style*="flex-wrap"] > div {
    padding: 6px 10px !important;
    border-radius: 8px !important;
  }
  .theme-detail div[style*="flex-wrap"] > div span[style*="font-size:12px"] {
    font-size: 11px !important;
  }
  .theme-detail button[onclick*="addThemeToWl"] {
    width: 100%;
    text-align: center;
    padding: 10px 16px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    margin-top: 12px !important;
  }

  /* ── AI-Surfaced Insights ───────────────────────────────────────────── */

  /* Insights header — stack title and button */
  .discover-sections section > div[style*="justify-content:space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  /* Tabs */
  .tab-btn { font-size: 12px !important; padding: 8px 14px !important; }

  /* Daily Report button — full width */
  .page-main button[onclick*="downloadDailyReport"] {
    width: 100%;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 10px 16px !important;
    border-radius: 10px !important;
  }

  /* News cards */
  .news-item .hover-card {
    padding: 12px !important;
    gap: 10px !important;
  }
  .news-expanded {
    padding: 0 12px 12px 12px !important;
  }
  .news-expanded div[style*="border-radius:8px"] {
    padding: 10px 12px !important;
  }

  /* Pagination — bigger touch targets */
  .news-page-btn {
    width: 36px; height: 36px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* ── ECS Info tooltip ───────────────────────────────────────────────── */
  .ecs-tooltip {
    max-width: 260px !important;
    font-size: 11px !important;
  }
}
