:root {
  --bg-1: #0d1b2a;
  --bg-2: #132a3d;
  --ink: #e0e7ee;
  --muted: #a7b7c8;
  --card: rgba(8, 15, 24, 0.72);
  --line: rgba(165, 188, 210, 0.22);
  --accent: #34d399;
  --accent-2: #f59e0b;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

/* Ensure the HTML `hidden` attribute always wins over class-level `display`
   rules. Without this, classes like .hero-button { display: inline-block; }
   override [hidden] and the element stays visible. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(1000px 500px at 10% -10%, #21405e 0%, transparent 70%),
    radial-gradient(900px 500px at 90% 0%, #264653 0%, transparent 65%),
    linear-gradient(150deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: rgba(52, 211, 153, 0.2);
  top: -60px;
  left: -60px;
  animation: driftA 14s ease-in-out infinite;
}

.orb-b {
  width: 220px;
  height: 220px;
  background: rgba(245, 158, 11, 0.2);
  right: -40px;
  bottom: 80px;
  animation: driftB 16s ease-in-out infinite;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}



.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.35);
}

.hero {
  padding: 28px;
  transform: translateY(8px);
  animation: riseIn 650ms ease forwards;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.78rem;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
}

.subtext {
  margin: 0 0 14px 0;
  color: var(--muted);
  max-width: 72ch;
}

.helper-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.helper-note kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--ink);
  background: rgba(16, 29, 45, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.hero-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

#symbol-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 29, 45, 0.9);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

#timeframe-select {
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 29, 45, 0.9);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

#symbol-input::placeholder {
  color: rgba(167, 183, 200, 0.6);
}

#symbol-input:focus,
#timeframe-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.2);
}

.hero-button {
  display: inline-block;
  width: auto;
  padding: 10px 24px;
  background: linear-gradient(90deg, var(--accent), #10b981);
  color: #052217;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.hero-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(52, 211, 153, 0.28);
}

.hero-button-alt {
  background: linear-gradient(90deg, #38bdf8, #22d3ee);
  color: #082534;
}



.chart-wrap {
  padding: 12px;
  animation: riseIn 860ms ease forwards;
  flex: 1;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 14px;
}

.chart-label {
  margin: 0 0 4px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.chart-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.chart-status {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 29, 45, 0.9);
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.chart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 29, 45, 0.9);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.zoom-button:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.18);
}

#tv-chart {
  width: 100%;
  height: min(84vh, 940px);
  min-height: 620px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.pnz-chart {
  cursor: crosshair;
}

@media (max-width: 720px) {
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-status {
    white-space: normal;
  }

  .chart-actions {
    width: 100%;
  }
}

.screener-wrap {
  padding: 18px;
}

.screener-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.screener-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.screener-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.screener-filters label {
  color: var(--muted);
  font-size: 0.84rem;
}

.screener-filters select {
  min-width: 180px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(165, 188, 210, 0.25);
  background: rgba(12, 23, 36, 0.9);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
}

.screener-filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.2);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(165, 188, 210, 0.25);
  background: rgba(12, 23, 36, 0.75);
  color: var(--ink);
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.hero-button-small {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.hero-button-ghost {
  background: rgba(16, 29, 45, 0.9);
  color: var(--ink);
  border: 1px solid rgba(165, 188, 210, 0.35);
}

.hero-button-ghost:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.18);
}

.screener-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.meta-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 18, 30, 0.62);
  padding: 10px;
  min-height: 120px;
}

.meta-card h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(14, 27, 42, 0.7);
  border: 1px solid rgba(165, 188, 210, 0.16);
}

#screener-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.screener-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.signal-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 180px;
  background: rgba(7, 14, 22, 0.55);
}

.signal-panel h4 {
  margin: 0 0 10px;
}

.buy-panel h4 {
  color: #4ade80;
}

.sell-panel h4 {
  color: #f87171;
}

.signal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.signal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(165, 188, 210, 0.2);
  background: rgba(14, 27, 42, 0.7);
  font-size: 0.88rem;
}

.signal-item.empty {
  color: var(--muted);
  justify-content: center;
}

.first-chip {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
}

.first-chip.buy {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.first-chip.sell {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.mcap-label {
  font-size: 0.70rem;
  color: var(--muted);
  margin-left: auto;
  margin-right: 6px;
}

@media (max-width: 880px) {
  .screener-meta {
    grid-template-columns: 1fr;
  }

  .screener-grid {
    grid-template-columns: 1fr;
  }

  .screener-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .screener-filters {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes driftA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(45px, 25px);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-30px, -35px);
  }
}



/* ─── Subscribe button & modal ──────────────────────────────────────── */
.hero-button-subscribe {
  background: linear-gradient(90deg, #a78bfa, #8b5cf6);
  color: #1e1b4b;
}

.hero-button-subscribe:hover {
  box-shadow: 0 8px 20px rgba(167, 139, 250, 0.35);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 10, 18, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 200ms ease;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: linear-gradient(160deg, #132a3d 0%, #0d1b2a 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: modalRise 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalRise {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(165, 188, 210, 0.1);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(165, 188, 210, 0.2);
}

.modal-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.modal-subtext {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.modal-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.modal-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(165, 188, 210, 0.22);
  border-radius: 12px;
  background: rgba(7, 14, 22, 0.5);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.modal-option:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(20, 30, 48, 0.7);
}

.modal-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #a78bfa;
  cursor: pointer;
}

.modal-option-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-option-label strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.modal-option-label small {
  color: var(--muted);
  font-size: 0.8rem;
}

.modal-cta {
  display: block;
  width: 100%;
  text-align: center;
  margin: 16px 0 4px;
  padding: 12px 18px;
  font-size: 0.95rem;
  text-decoration: none;
  background: linear-gradient(90deg, #a78bfa, #8b5cf6);
  color: #1e1b4b;
}

.modal-cta:hover {
  box-shadow: 0 8px 20px rgba(167, 139, 250, 0.4);
}

.modal-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.modal-error {
  color: #f87171;
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.modal-fineprint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.modal-fineprint code {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.modal-link-text {
  display: inline-block;
  word-break: break-all;
  margin-top: 4px;
  padding: 6px 8px;
  background: rgba(7, 14, 22, 0.7);
  border: 1px solid rgba(165, 188, 210, 0.2);
  font-size: 0.74rem;
}

/* ─── Symbol input + suggestions dropdown ──────────────────────────── */
.symbol-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.symbol-input-wrap #symbol-input {
  width: 100%;
}

.symbol-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(8, 15, 24, 0.97);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 12px;
  padding: 8px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.symbol-suggestions[hidden] {
  display: none !important;
}

.symbol-suggestions .suggestion-group-label {
  margin: 6px 6px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.symbol-suggestions .suggestion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
  font-size: 0.86rem;
}

.symbol-suggestions .suggestion-row:hover,
.symbol-suggestions .suggestion-row.active {
  background: rgba(52, 211, 153, 0.14);
}

.symbol-suggestions .suggestion-symbol {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.86rem;
  color: var(--ink);
}

.symbol-suggestions .suggestion-name {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.symbol-suggestions .suggestion-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}
