/* PokeTrack BR — Design System */
:root {
  --accent: #FFCC02;
  --accent-dark: #E6B800;
  --bg: #0f0f13;
  --bg-card: #1a1a22;
  --bg-elevated: #22222e;
  --border: #2e2e3e;
  --text: #f0f0f5;
  --text-muted: #8888aa;
  --text-subtle: #555570;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ──────────── TYPOGRAPHY ──────────── */
h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.8rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.accent { color: var(--accent); }
.muted  { color: var(--text-muted); }

/* ──────────── LAYOUT ──────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }

/* ──────────── NAV ──────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,19,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
}

nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}

.logo span { color: var(--accent); }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

nav a:hover, nav a.active {
  color: var(--text);
  background: var(--bg-elevated);
}

/* ──────────── BUTTONS ──────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #111;
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* ──────────── CARDS ──────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.card:hover { border-color: var(--accent); }

.card-elevated {
  background: var(--bg-elevated);
}

/* ──────────── INPUTS ──────────── */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,204,2,0.12);
}

.input-wrap input { padding-left: 44px; }

input::placeholder { color: var(--text-subtle); }

/* ──────────── BADGES ──────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-alta    { background: rgba(34,197,94,0.15);  color: #22c55e; }
.badge-queda   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.badge-estavel { background: rgba(255,204,2,0.12);  color: var(--accent); }
.badge-rare    { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* ──────────── HERO ──────────── */
.hero {
  padding: 96px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,204,2,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 { margin-bottom: 20px; }
.hero p  { font-size: 1.15rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 36px; }

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ──────────── GRID ──────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ──────────── STAT ──────────── */
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ──────────── PRICE DISPLAY ──────────── */
.price-brl {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.price-usd {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.price-min { color: var(--danger); font-weight: 600; }
.price-max { color: var(--success); font-weight: 600; }

/* ──────────── TREND ──────────── */
.trend-up   { color: var(--success); }
.trend-down { color: var(--danger);  }
.trend-flat { color: var(--text-muted); }

/* ──────────── CHART CONTAINER ──────────── */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 200px;
}

/* ──────────── CARD RESULT ──────────── */
.card-result {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.card-result img {
  width: 100px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  object-fit: contain;
}

.card-result-info { flex: 1; }
.card-result-info h3 { margin-bottom: 4px; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

/* ──────────── SEARCH RESULTS ──────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

/* ──────────── FEATURE LIST ──────────── */
.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,204,2,0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

/* ──────────── FOOTER ──────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ──────────── BOTÕES DE AÇÃO DO MODAL ──────────── */
.btn-historico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-historico:hover { border-color: var(--accent); color: var(--accent); }

.btn-venda {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.07);
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}
.btn-venda:hover { border-color: var(--success); background: rgba(34,197,94,0.15); }

/* ──────────── BADGE DE PREÇO ──────────── */
.preco-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255,204,2,0.13);
  color: var(--accent);
  letter-spacing: 0.01em;
}
.preco-badge-cm {
  background: rgba(59,130,246,0.13);
  color: #60a5fa;
}
.preco-fonte {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.75;
  letter-spacing: 0.04em;
}
.preco-badge-skel {
  display: inline-block;
  width: 60px;
  height: 18px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

/* ──────────── LOADING ──────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ──────────── TOAST ──────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  max-width: 320px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ──────────── EMPTY STATE ──────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state .emoji { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { max-width: 340px; margin: 8px auto 0; font-size: 0.9rem; }

/* ──────────── DIVIDER ──────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ──────────── RESPONSIVE ──────────── */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
  }

  .hero { padding: 64px 24px 48px; }

  nav ul { display: none; }

  .card-result { flex-direction: column; }
  .card-result img { width: 80px; }

  /* Modais responsivos */
  [id*="modal"] > .card,
  [id*="modal"] > div > .card {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0 auto !important;
  }
  [id*="modal"] img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Filtros mercado — empilhar em coluna única */
  .mercado-filtros { flex-direction: column !important; }
  .mercado-filtros > div { width: 100% !important; min-width: unset !important; flex: none !important; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; align-items: center; }
}
