/* ==========================================
   CLEANSHAVE'S TOOL - FRONT PAGE "TERMINAL" THEME
   Loaded after styles.css on index.html only.
   Everything is scoped to body.terminal-page so the
   other pages that share styles.css are unaffected.
   The header, ticker and live badge styles live in
   shell.css (shared by every page).
   ========================================== */

.terminal-page {
  --t-bg: #121212;
  --t-panel: #1e1e1e;
  --t-panel-2: #1a1a1a;
  --t-line: #2a2a2a;
  --t-line-2: #333;
  --t-accent: #00ffc3;
  --t-accent-hover: #00d4a3;
  --t-teal: #00695c;
  --t-teal-hover: #00534a;
  --t-text: #F3F4F6;
  --t-text-2: #D1D5DB;
  --t-muted: #9CA3AF;
  --t-up: #10B981;
  --t-down: #F87171;
  --t-blue: #60A5FA;
  --t-amber: #fbbf24;
  --t-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* header (69px) + ticker (~38px) + gap */
  padding: 124px 0 24px 0;
  background: var(--t-bg);
}

.terminal-page *,
.terminal-page *::before,
.terminal-page *::after {
  box-sizing: border-box;
}

.terminal-page .t-accent { color: var(--t-accent); }

.terminal-page .t-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--t-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.terminal-page .t-up { color: var(--t-up); }
.terminal-page .t-down { color: var(--t-down); }
.terminal-page .t-flat { color: var(--t-muted); }

/* ==========================================
   LAYOUT
   ========================================== */

.terminal-page .t-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.terminal-page .t-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.terminal-page .t-main,
.terminal-page .t-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (min-width: 1024px) {
  .terminal-page .t-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .terminal-page .t-side {
    position: sticky;
    top: 124px;
  }
}

/* ==========================================
   COMMAND SEARCH
   ========================================== */

.terminal-page .t-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 6px 0 14px;
  background: var(--t-panel-2);
  border: 1px solid var(--t-teal);
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(0, 255, 195, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.terminal-page .t-search:focus-within {
  border-color: var(--t-accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 195, 0.15);
}

.terminal-page .t-search-prompt {
  font-family: var(--t-mono);
  font-weight: 700;
  color: var(--t-accent);
}

.terminal-page .t-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--t-text);
  font-family: var(--t-mono);
  font-size: 16px; /* 16px stops iOS from zooming on focus */
  outline: none;
}

.terminal-page .t-search input::placeholder { color: #6B7280; }

.terminal-page .t-search-btn {
  width: 44px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: var(--t-teal);
  color: #fff;
  cursor: pointer;
}

.terminal-page .t-search-btn:hover { background: var(--t-teal-hover); }

.terminal-page .search-results-section { margin-top: 0; }

/* ==========================================
   STAT TILES
   ========================================== */

.terminal-page .t-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 640px) {
  .terminal-page .t-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.terminal-page .t-tile {
  background: var(--t-panel);
  border: 1px solid var(--t-line);
  border-radius: 10px;
  padding: 12px;
  min-width: 0;
}

.terminal-page .t-tile .t-label {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-page .t-tile-value {
  font-family: var(--t-mono);
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--t-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-page .t-tile-sub {
  font-family: var(--t-mono);
  font-size: 11.5px;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================
   AIUS SPOTLIGHT
   ========================================== */

.terminal-page .t-spotlight {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(160deg, #1a1a2e, #16213e);
  border: 1px solid var(--t-accent);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 255, 195, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.terminal-page .t-spotlight:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 255, 195, 0.2);
}

.terminal-page .t-spot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.terminal-page .t-spot-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.terminal-page .t-spot-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--t-accent);
  flex-shrink: 0;
}

.terminal-page .t-spot-code {
  font-size: 24px;
  font-weight: 700;
  color: var(--t-accent);
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(0, 255, 195, 0.3);
}

.terminal-page .t-spot-price { text-align: right; }

.terminal-page .t-spot-price-val {
  font-family: var(--t-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--t-up);
}

.terminal-page .t-spot-change {
  font-family: var(--t-mono);
  font-size: 12px;
}

.terminal-page .t-spot-chart {
  height: 64px;
  margin-top: 12px;
}

.terminal-page .t-spot-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.terminal-page .t-spot-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.terminal-page .t-mini-label {
  font-size: 11px;
  color: var(--t-muted);
}

.terminal-page .t-mini-val {
  font-family: var(--t-mono);
  font-size: 13px;
  color: var(--t-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-page .t-spot-desc {
  margin: 12px 0 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--t-text-2);
}

/* ==========================================
   MARKET TABS + LIST
   ========================================== */

.terminal-page .t-market {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.terminal-page .t-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--t-panel-2);
  border: 1px solid var(--t-line);
  border-radius: 10px;
}

.terminal-page .t-tab {
  flex: 1;
  height: 40px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--t-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.terminal-page .t-tab:hover { background: #2a2a2a; color: var(--t-text); }

.terminal-page .t-tab.active {
  background: var(--t-teal);
  color: #fff;
}

.terminal-page .t-tab .fa-star { font-size: 0.85em; }

.terminal-page .t-market-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.terminal-page .currency-btn { min-height: 32px; }

.terminal-page .t-list {
  background: var(--t-panel);
  border: 1px solid var(--t-line);
  border-radius: 12px;
  overflow: hidden;
}

.terminal-page .t-row {
  display: grid;
  grid-template-columns: 18px 34px minmax(0, 1fr) 58px auto 36px;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 10px 12px;
  min-height: 60px;
  border-bottom: 1px solid #262626;
  cursor: pointer;
  transition: background-color 0.15s;
}

.terminal-page .t-row:last-child { border-bottom: none; }
.terminal-page .t-row:hover { background: #242424; }

.terminal-page .t-rank {
  font-family: var(--t-mono);
  font-size: 11px;
  color: var(--t-muted);
  text-align: right;
}

.terminal-page .t-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 1px solid var(--t-teal);
  object-fit: cover;
}

.terminal-page .t-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--t-accent);
}

.terminal-page .t-name { min-width: 0; }

.terminal-page .t-code {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--t-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-page .t-row:hover .t-code { color: var(--t-accent); }

.terminal-page .t-sub {
  display: block;
  font-family: var(--t-mono);
  font-size: 11px;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-page .t-spark svg { display: block; }

.terminal-page .t-price {
  text-align: right;
  min-width: 0;
}

.terminal-page .t-price-val {
  display: block;
  font-family: var(--t-mono);
  font-size: 12.5px;
  color: var(--t-text);
  white-space: nowrap;
}

.terminal-page .t-pill {
  display: inline-block;
  margin-top: 3px;
  min-width: 62px;
  padding: 3px 6px;
  border-radius: 6px;
  font-family: var(--t-mono);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}

.terminal-page .t-pill.up { background: var(--t-up); color: #052e1f; }
.terminal-page .t-pill.down { background: var(--t-down); color: #3b0a0a; }
.terminal-page .t-pill.flat { background: #2c2c2c; color: var(--t-muted); }

.terminal-page .t-star {
  width: 36px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #4B5563;
  font-size: 15px;
  cursor: pointer;
}

.terminal-page .t-star:hover { color: var(--t-amber); background: transparent; }
.terminal-page .t-star.on { color: var(--t-amber); }

.terminal-page .t-empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--t-muted);
  font-size: 14px;
}

.terminal-page .t-more {
  height: 48px;
  border: 1px solid var(--t-teal);
  border-radius: 10px;
  background: transparent;
  color: var(--t-accent);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.terminal-page .t-more:hover { background: #0f2a26; }

.terminal-page .last-updated {
  margin-top: 0;
  font-family: var(--t-mono);
}

/* Narrow phones: drop the sparkline column */
@media (max-width: 370px) {
  .terminal-page .t-row { grid-template-columns: 18px 34px minmax(0, 1fr) auto 36px; }
  .terminal-page .t-spark { display: none; }
}

/* ==========================================
   SIDE PANELS (RADAR + TAPE)
   ========================================== */

.terminal-page .t-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.terminal-page .t-panel-head h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: 700;
}

.terminal-page .t-panel-head .currency-btn {
  padding: 6px 10px;
  font-size: 12px;
}

/* ---- Rug Radar ---- */

.terminal-page .t-radar {
  background: var(--t-panel);
  border: 1px solid #b45309;
  border-radius: 12px;
  padding: 14px;
}

.terminal-page .t-radar-title { color: var(--t-amber); }

.terminal-page .t-radar-desc {
  margin: 8px 0 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--t-muted);
}

.terminal-page .t-radar-desc b { color: var(--t-text-2); font-weight: 600; }

.terminal-page .t-radar-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
}

.terminal-page .t-radar-row {
  display: block;
  padding: 8px 4px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.terminal-page .t-radar-row:hover { background: #242424; }

.terminal-page .t-radar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.terminal-page .t-radar-top b { color: var(--t-text); }

.terminal-page .t-radar-pct {
  font-family: var(--t-mono);
  font-weight: 700;
  white-space: nowrap;
}

.terminal-page .t-radar-band {
  color: var(--t-muted);
  font-weight: 400;
  font-size: 12px;
}

.terminal-page .t-band-thin { color: var(--t-down); }
.terminal-page .t-band-watch { color: var(--t-amber); }
.terminal-page .t-band-deep { color: #22c55e; }

.terminal-page .t-gauge {
  position: relative;
  height: 10px;
  margin-top: 7px;
  border-radius: 5px;
  background: linear-gradient(to right, #dc2626, #f59e0b 50%, #22c55e);
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.4);
}

.terminal-page .t-gauge-needle {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 18px;
  margin-left: -1px;
  border-radius: 2px;
  background: #f9fafb;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  transition: left 0.5s ease;
}

.terminal-page .t-radar-detail {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--t-mono);
  font-size: 11px;
  color: var(--t-muted);
}

.terminal-page .t-radar-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--t-line);
  font-family: var(--t-mono);
  font-size: 11px;
  color: var(--t-muted);
}

.terminal-page .t-sw {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 5px;
}

.terminal-page .t-sw-thin { background: #dc2626; }
.terminal-page .t-sw-watch { background: #f59e0b; }
.terminal-page .t-sw-deep { background: #22c55e; }

.terminal-page .t-radar-foot {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--t-muted);
}

/* ---- Live Tape ---- */

.terminal-page .t-tape {
  background: var(--t-panel);
  border: 1px solid var(--t-line);
  border-radius: 12px;
  overflow: hidden;
}

.terminal-page .t-tape .t-panel-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--t-line);
}

.terminal-page .t-tape-title { color: var(--t-accent); }

.terminal-page .t-tape-cols,
.terminal-page .t-tape-row {
  display: grid;
  grid-template-columns: 62px 40px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0 14px;
  font-family: var(--t-mono);
}

.terminal-page .t-tape-cols {
  padding-top: 8px;
  padding-bottom: 6px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #6B7280;
  border-bottom: 1px solid #262626;
}

.terminal-page .t-tape-cols span:last-child { text-align: right; }

.terminal-page .t-tape-list {
  height: 432px; /* 12 rows; fixed so the page doesn't jump */
  overflow: hidden;
}

.terminal-page .t-tape-row {
  align-items: center;
  height: 36px;
  font-size: 12px;
  text-decoration: none;
  color: var(--t-text);
  border-bottom: 1px solid #262626;
}

.terminal-page a.t-tape-row:hover { background: #242424; }

.terminal-page .t-tape-row.is-new { animation: t-flash 1.2s ease-out; }

.terminal-page .t-tape-row.is-whale {
  background: rgba(0, 255, 195, 0.07);
}

.terminal-page .t-tape-row.is-whale .t-tape-size {
  color: var(--t-accent);
  font-weight: 700;
}

.terminal-page .t-tape-time { color: var(--t-muted); }
.terminal-page .t-tape-buy { color: var(--t-up); font-weight: 700; }
.terminal-page .t-tape-sell { color: var(--t-down); font-weight: 700; }

.terminal-page .t-tape-asset {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-page .t-tape-asset .t-tracked-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--t-accent);
  vertical-align: middle;
}

.terminal-page .t-tape-pair { color: #6B7280; }

.terminal-page .t-tape-size {
  text-align: right;
  white-space: nowrap;
}

@keyframes t-flash {
  from { background: rgba(0, 255, 195, 0.18); }
  to { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .terminal-page .t-tape-row.is-new { animation: none; }
}

.terminal-page .t-tape-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--t-line);
  font-family: var(--t-mono);
  font-size: 11px;
  color: var(--t-muted);
}

/* ==========================================
   FOOTER
   ========================================== */

.terminal-page .t-footer {
  margin-top: 28px;
  padding: 24px 16px;
  text-align: center;
  background: var(--t-panel-2);
  border: 1px solid var(--t-line-2);
  border-radius: 12px;
}

.terminal-page .t-footer h2 {
  margin: 0 0 8px 0;
  font-size: 1.25em;
  color: var(--t-accent);
}

.terminal-page .t-footer p {
  max-width: 640px;
  margin: 0 auto 16px auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--t-text-2);
}

.terminal-page .t-tg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--t-teal);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.terminal-page .t-tg:hover { background: var(--t-teal-hover); }

/* ==========================================
   OVERRIDES FOR styles.css MOBILE RULES
   ========================================== */

@media (max-width: 768px) {
  .terminal-page { padding-top: 124px; }
}
