/* ============================================
   Smart Asset Analyzer — Mobile-first Styles
   ============================================ */

:root {
  --bg: #0a0e1a;
  --bg-soft: #111827;
  --card: #1a1f35;
  --card-2: #1e2545;
  --border: rgba(255, 255, 255, 0.07);
  --text: #f0f4ff;
  --text-dim: #8b95b0;
  --accent: #6366f1;
  --accent-2: #a78bfa;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --cyan: #06b6d4;
  --pink: #ec4899;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  background-image:
    radial-gradient(ellipse at 15% -5%, rgba(99, 102, 241, 0.2), transparent 50%),
    radial-gradient(ellipse at 85% 15%, rgba(167, 139, 250, 0.12), transparent 45%),
    radial-gradient(ellipse at 50% 105%, rgba(6, 182, 212, 0.08), transparent 50%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-2);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ===== MAIN ===== */
main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 48px;
}

/* ===== CARDS ===== */
.card {
  background: linear-gradient(160deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}

.section-head h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 30px 18px 26px;
}

.hero-kicker {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.hero-title {
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== ASSET GRID ===== */
.asset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.asset-card {
  background: linear-gradient(160deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: default;
}

.asset-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-accent, var(--accent));
}

.asset-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.asset-icon {
  font-size: 2rem;
  line-height: 1;
}

.asset-rank {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.asset-rank.rank-1 { background: rgba(16, 185, 129, 0.2); color: var(--green); }
.asset-rank.rank-2 { background: rgba(99, 102, 241, 0.2); color: var(--accent-2); }
.asset-rank.rank-3 { background: rgba(245, 158, 11, 0.2); color: var(--orange); }
.asset-rank.rank-4 { background: rgba(236, 72, 153, 0.2); color: var(--pink); }
.asset-rank.rank-5 { background: rgba(139, 149, 176, 0.15); color: var(--text-dim); }

.asset-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.asset-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.asset-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 800;
}

.metric-value.positive { color: var(--green); }
.metric-value.negative { color: var(--red); }
.metric-value.neutral { color: var(--orange); }

.asset-bar {
  margin-top: 12px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.asset-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s ease;
}

.asset-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ===== CHART CARDS ===== */
.chart-card .chart-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 260px;
}

.chart-card .chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===== COMPARISON TABLE ===== */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  font-size: 0.88rem;
}

.compare-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.compare-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table .asset-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.compare-table .verdict-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.verdict-excellent { background: rgba(16, 185, 129, 0.2); color: var(--green); }
.verdict-good { background: rgba(99, 102, 241, 0.2); color: var(--accent-2); }
.verdict-moderate { background: rgba(245, 158, 11, 0.2); color: var(--orange); }
.verdict-risky { background: rgba(239, 68, 68, 0.2); color: var(--red); }

/* ===== RISK PROFILE TABS ===== */
.risk-profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.profile-tab {
  flex: 1;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px 6px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.profile-tab.is-active {
  background: var(--card-2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== ALLOCATION ===== */
.allocation-chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 16px;
}

.allocation-chart-wrapper canvas {
  width: 100% !important;
  height: auto !important;
}

.allocation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alloc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.alloc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  min-width: 10px;
}

.alloc-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
}

.alloc-pct {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-2);
}

/* ===== PROS & CONS ===== */
.proscons-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proscons-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.proscons-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.proscons-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.proscons-list li {
  font-size: 0.88rem;
  color: var(--text-dim);
  padding-left: 20px;
  position: relative;
}

.proscons-list li::before {
  position: absolute;
  left: 0;
  font-size: 0.85rem;
}

.pro-list li::before { content: "✅"; }
.con-list li::before { content: "⚠️"; }

/* ===== BEST PICK ===== */
.best-pick-card {
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.12), var(--card-2));
  border-color: rgba(16, 185, 129, 0.25);
}

.best-pick-content {
  text-align: center;
}

.best-pick-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.best-pick-name {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.best-pick-score {
  font-size: 1rem;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 12px;
}

.best-pick-reason {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 450px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== BUTTONS ===== */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover { filter: brightness(1.1); }

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.footer-tagline {
  margin-top: 6px;
  font-weight: 600;
  color: var(--text);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .card { padding: 26px 24px; }
  .asset-grid { gap: 16px; }
}

@media (min-width: 640px) {
  .asset-grid { grid-template-columns: 1fr 1fr; }
  .proscons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

@media (min-width: 768px) {
  .hero-title { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .site-header .header-inner {
    padding-top: max(14px, env(safe-area-inset-top));
  }
  main {
    padding-bottom: max(48px, env(safe-area-inset-bottom));
  }
}
