/* DegenLens — App pages (screener, token detail, briefing)
 * Inherits variables from main.css. Never redefine :root here.
 */

/* ── App body / nav ── */
.app-body { padding-top: 72px; }

.app-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7,16,13,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.app-nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-nav .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}
.app-nav .logo-icon { color: var(--gold); font-size: 1.2rem; }
.app-nav .logo-text { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; }

.app-nav-links { display: flex; gap: 8px; }
.app-nav-link {
  padding: 6px 16px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.app-nav-link:hover, .app-nav-link.active {
  background: var(--bg-3);
  color: var(--text);
}
.app-nav-link.active { color: var(--gold); }

/* ── Main ── */
.app-main { min-height: calc(100vh - 64px - 80px); padding: 40px 0 60px; }

.container-narrow { max-width: 780px; }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.page-sub { color: var(--text-2); font-size: 0.95rem; }

.briefing-btn {
  padding: 10px 20px;
  background: var(--bg-3);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  color: var(--gold);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}
.briefing-btn:hover { background: rgba(201,168,76,0.1); }

/* ── Search bar ── */
.search-wrap {
  margin-bottom: 20px;
}
.token-search-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.token-search-input::placeholder { color: var(--text-3); }
.token-search-input:focus { border-color: var(--border-gold); }
.token-search-input::-webkit-search-cancel-button { cursor: pointer; }

/* ── Filter tabs ── */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  background: transparent;
}
.filter-tab:hover { border-color: var(--text-3); color: var(--text); }
.filter-tab.active { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.08); }
.halal-tab.active   { border-color: #22c55e; color: #22c55e; background: rgba(34,197,94,0.08); }
.doubtful-tab.active { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,0.08); }
.haram-tab.active   { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.08); }

/* ── Token grid ── */
.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.token-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.token-card:hover { border-color: var(--border-gold); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.token-card.status-halal   { border-left: 3px solid #22c55e; }
.token-card.status-doubtful { border-left: 3px solid #f59e0b; }
.token-card.status-haram   { border-left: 3px solid #ef4444; }

.token-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.token-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.token-img { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.token-img-placeholder {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-3); display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: var(--gold); flex-shrink: 0;
}
.token-meta { min-width: 0; }
.token-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.token-symbol { color: var(--text-2); font-size: 0.8rem; }

.status-badge {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-badge-halal   { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-badge-doubtful { background: rgba(245,158,11,0.15); color: #f59e0b; }
.status-badge-haram   { background: rgba(239,68,68,0.15); color: #ef4444; }

.token-price-row { display: flex; align-items: center; justify-content: space-between; }
.token-price { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; }
.token-change { font-size: 0.85rem; font-weight: 600; }
.up   { color: #22c55e; }
.down { color: #ef4444; }
.flat { color: var(--text-2); }

.token-mcap { color: var(--text-2); font-size: 0.82rem; }

.compliance-bar-wrap { display: flex; align-items: center; gap: 10px; }
.compliance-bar-track { flex: 1; height: 6px; background: var(--bg-3); border-radius: 100px; overflow: hidden; }
.compliance-bar-lg { height: 10px; }
.compliance-bar-fill { height: 100%; border-radius: 100px; transition: width 0.5s ease; }
.status-fill-halal   { background: linear-gradient(90deg, #16a34a, #22c55e); }
.status-fill-doubtful { background: linear-gradient(90deg, #d97706, #f59e0b); }
.status-fill-haram   { background: linear-gradient(90deg, #dc2626, #ef4444); }
.compliance-score { font-size: 0.8rem; color: var(--text-2); white-space: nowrap; }

.token-reason {
  font-size: 0.78rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  line-height: 1.4;
}

/* ── Legend ── */
.screener-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-2);
}
.legend-note { color: var(--text-3); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--text-2);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h2 { font-family: 'Syne', sans-serif; font-size: 1.4rem; margin-bottom: 8px; color: var(--text); }

/* ── Token detail ── */
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--gold); }

.token-detail-header {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.status-border-halal   { border-left: 4px solid #22c55e; }
.status-border-doubtful { border-left: 4px solid #f59e0b; }
.status-border-haram   { border-left: 4px solid #ef4444; }

.token-detail-identity { display: flex; align-items: center; gap: 16px; }
.token-detail-img { width: 52px; height: 52px; border-radius: 50%; }
.token-detail-name { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; }
.token-detail-symbol { color: var(--text-2); font-size: 1rem; font-weight: 400; }
.token-rank { color: var(--text-2); font-size: 0.9rem; margin-top: 4px; }

.token-verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 24px;
  border-radius: var(--radius);
}
.status-badge-lg { font-size: 1rem; }
.verdict-icon { font-size: 2rem; }
.verdict-text { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.detail-card:last-child { margin-bottom: 0; }
.detail-grid .detail-card { margin-bottom: 0; }

.score-label { color: var(--text-2); font-size: 0.85rem; margin-bottom: 8px; }
.score-value { font-family: 'Syne', sans-serif; font-size: 3rem; font-weight: 800; line-height: 1; margin-bottom: 12px; }
.score-max { font-size: 1.2rem; color: var(--text-3); }
.status-text-halal   { color: #22c55e; }
.status-text-doubtful { color: #f59e0b; }
.status-text-haram   { color: #ef4444; }
.score-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-3); margin-top: 8px; }

.market-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.market-row:last-child { border-bottom: none; }
.market-label { color: var(--text-2); font-size: 0.88rem; }
.market-val { font-weight: 600; font-size: 0.92rem; }

.analysis-title { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.reasons-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.reason-item { display: flex; gap: 10px; font-size: 0.9rem; line-height: 1.5; }
.reason-bullet { font-size: 1rem; font-weight: 700; flex-shrink: 0; margin-top: 2px; }

.disclaimer-box {
  background: rgba(201,168,76,0.07);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.6;
}

.token-description { color: var(--text-2); font-size: 0.9rem; line-height: 1.7; }
.detail-cta { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; flex-wrap: wrap; gap: 12px; }

/* ── Briefing page ── */
.briefing-header { text-align: center; margin-bottom: 40px; }
.briefing-date-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(201,168,76,0.12);
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.briefing-title { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.briefing-sub { color: var(--text-2); font-size: 0.95rem; }
.briefing-updated { color: var(--text-3); font-size: 0.8rem; margin-top: 8px; }

.briefing-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
@media (max-width: 640px) { .briefing-stats { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
}
.halal-stat   { border-top: 3px solid #22c55e; }
.doubtful-stat { border-top: 3px solid #f59e0b; }
.haram-stat   { border-top: 3px solid #ef4444; }
.total-stat   { border-top: 3px solid var(--gold); }
.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-count { font-family: 'Syne', sans-serif; font-size: 2rem; font-weight: 800; }
.stat-label { color: var(--text-2); font-size: 0.82rem; margin-top: 4px; }

.briefing-section { margin-bottom: 40px; }
.briefing-section-title { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }

/* Movers */
.movers-list { display: flex; flex-direction: column; gap: 10px; }
.mover-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}
.mover-item:hover { border-color: var(--border-gold); }
.mover-img { width: 32px; height: 32px; border-radius: 50%; }
.mover-meta { flex: 1; }
.mover-name { font-weight: 600; font-size: 0.95rem; }
.mover-symbol { color: var(--text-2); font-size: 0.8rem; margin-left: 6px; }
.mover-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.mover-price { font-weight: 600; font-size: 0.9rem; }
.mover-change { font-size: 0.85rem; font-weight: 600; }

/* Briefing token list */
.briefing-token-list { display: flex; flex-direction: column; gap: 8px; }
.briefing-token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}
.briefing-token-row:hover { border-color: var(--border-gold); }
.briefing-token-left { display: flex; align-items: center; gap: 10px; }
.briefing-rank { color: var(--text-3); font-size: 0.8rem; min-width: 28px; }
.briefing-token-img { width: 28px; height: 28px; border-radius: 50%; }
.briefing-token-name { font-weight: 600; font-size: 0.9rem; }
.briefing-token-symbol { color: var(--text-2); font-size: 0.78rem; margin-left: 6px; }
.briefing-token-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.briefing-score { font-size: 0.8rem; color: var(--text-2); }
.briefing-price { font-weight: 600; font-size: 0.88rem; }
.briefing-change { font-size: 0.82rem; font-weight: 600; }

.see-all-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  background: var(--bg-3);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  color: var(--gold);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
}
.see-all-btn:hover { background: rgba(201,168,76,0.1); }

/* Briefing disclaimer */
.briefing-disclaimer {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 32px;
  line-height: 1.6;
}
.briefing-disclaimer a { color: var(--gold); text-decoration: none; }

/* Briefing bottom CTA — reuse landing page card styles */
.briefing-cta-card {
  position: relative;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  overflow: hidden;
  margin-bottom: 40px;
}
.briefing-cta-card h2 { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.briefing-cta-card p { color: var(--text-2); margin-bottom: 20px; }

/* App footer */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
}
.app-footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.app-footer .footer-mission { color: var(--text-3); font-size: 0.82rem; }
.app-footer .footer-link { color: var(--text-2); text-decoration: none; font-size: 0.82rem; }
.app-footer .footer-link:hover { color: var(--gold); }

/* ── CTA button (shared) ── */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lit));
  color: #07100d;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.cta-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(201,168,76,0.35); }

/* Responsive */
@media (max-width: 768px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .token-grid { grid-template-columns: 1fr; }
  .token-detail-header { flex-direction: column; }
  .briefing-title { font-size: 1.4rem; }

  /* Briefing token rows — stack price/change below name on mobile */
  .briefing-token-row { flex-wrap: wrap; gap: 8px; }
  .briefing-token-right { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
  .briefing-score { display: none; } /* hide score on mobile to reduce clutter */

  /* Mover items — keep them compact */
  .mover-item { flex-wrap: wrap; }
  .mover-right { flex-direction: row; gap: 10px; align-items: center; }

  /* Filter tabs wrap */
  .filter-tabs { gap: 6px; }
  .filter-tab { padding: 6px 12px; font-size: 0.8rem; }
}
