/* src/dashboard/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base:       #0a0e1a;
  --bg-card:       #111827;
  --bg-card-hover: #1a2235;
  --bg-glass:      rgba(17, 24, 39, 0.8);
  --border:        rgba(255,255,255,0.07);
  --border-glow:   rgba(99,102,241,0.4);

  --accent:        #6366f1;
  --accent-light:  #818cf8;
  --accent-glow:   rgba(99,102,241,0.25);
  --gold:          #f59e0b;
  --green:         #10b981;
  --red:           #ef4444;
  --orange:        #f97316;
  --yellow:        #eab308;

  --text-primary:  #f1f5f9;
  --text-muted:    #94a3b8;
  --text-faint:    #475569;

  --radius:        12px;
  --radius-lg:     16px;
  --shadow:        0 4px 32px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 40px rgba(99,102,241,0.15);
}

/* ── Tema Claro ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:       #f0f4f8;
  --bg-card:       #ffffff;
  --bg-card-hover: #f7faff;
  --bg-glass:      rgba(255, 255, 255, 0.85);
  --border:        rgba(0,0,0,0.08);
  --border-glow:   rgba(99,102,241,0.35);

  --accent:        #4f46e5;
  --accent-light:  #6366f1;
  --accent-glow:   rgba(99,102,241,0.15);
  --gold:          #d97706;
  --green:         #059669;
  --red:           #dc2626;
  --orange:        #ea580c;
  --yellow:        #ca8a04;

  --text-primary:  #0f172a;
  --text-muted:    #475569;
  --text-faint:    #94a3b8;

  --shadow:        0 4px 24px rgba(0,0,0,0.10);
  --shadow-glow:   0 0 32px rgba(99,102,241,0.12);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(99,102,241,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(16,185,129,0.04) 0%, transparent 60%);
}

[data-theme="light"] header {
  background: rgba(240,244,248,0.97);
}

[data-theme="light"] .footer-bar {
  background: rgba(240,244,248,0.98);
}

[data-theme="light"] .mock-badge {
  background: rgba(217,119,6,0.12);
}

[data-theme="light"] .provider-card:hover {
  box-shadow: 0 4px 24px rgba(99,102,241,0.12);
}

[data-theme="light"] .score-row {
  background: rgba(0,0,0,0.03);
}

[data-theme="light"] thead tr {
  background: rgba(0,0,0,0.03);
}

[data-theme="light"] tbody tr:hover {
  background: rgba(0,0,0,0.02);
}

[data-theme="light"] .time-btn:hover {
  background: rgba(0,0,0,0.06);
}

/* ── Transição suave de tema ────────────────────────────── */
*, *::before, *::after {
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}



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

html { scroll-behavior: smooth; }

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

/* ── Background animado ─────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(16,185,129,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: rgba(10,14,26,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Botão de tema ──────────────────────────────────────── */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.theme-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--border-glow);
  transform: rotate(15deg) scale(1.1);
}

.theme-btn:active {
  transform: scale(0.92);
}

[data-theme="light"] .theme-btn {
  background: rgba(0,0,0,0.05);
}

[data-theme="light"] .theme-btn:hover {
  background: rgba(0,0,0,0.10);
}


.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.mock-badge {
  background: rgba(245,158,11,0.15);
  color: var(--gold);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── Main ───────────────────────────────────────────────── */
main {
  padding: 32px 0 80px;
}

/* ── Section title ──────────────────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

/* ── Summary row ────────────────────────────────────────── */
.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .summary-row { grid-template-columns: 1fr; }
}

/* ── Provider cards ─────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: default;
}

.provider-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.provider-card.best {
  border-color: rgba(16,185,129,0.4);
  box-shadow: 0 0 30px rgba(16,185,129,0.1);
}

.provider-card.error-state {
  border-color: rgba(239,68,68,0.3);
  opacity: 0.85;
}

.provider-card.pending-state {
  border-color: rgba(245,158,11,0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.provider-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.provider-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.badge-online    { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.badge-error     { background: rgba(239,68,68,0.15);  color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }
.badge-pending   { background: rgba(245,158,11,0.15); color: var(--gold);  border: 1px solid rgba(245,158,11,0.3); }
.badge-suspended { background: rgba(148,163,184,0.12); color: #64748b;     border: 1px solid rgba(148,163,184,0.25); }
.badge-unknown   { background: rgba(148,163,184,0.1); color: var(--text-muted); border: 1px solid var(--border); }

.card-main-amount {
  margin-bottom: 20px;
}

.amount-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.amount-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  line-height: 1.1;
}

.amount-currency {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.amount-rate {
  font-size: 12px;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
}

.card-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Stats grid no card */
.card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }
.stat-value.muted    { color: var(--text-muted); }

/* Score badge */
.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.score-label { font-size: 12px; color: var(--text-muted); }

.score-value {
  font-size: 22px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}

.score-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.pending-message {
  font-size: 13px;
  color: var(--gold);
  background: rgba(245,158,11,0.07);
  border-radius: var(--radius);
  padding: 12px 16px;
  border: 1px solid rgba(245,158,11,0.15);
  line-height: 1.5;
}

.error-message {
  font-size: 13px;
  color: var(--red);
  background: rgba(239,68,68,0.07);
  border-radius: var(--radius);
  padding: 12px 16px;
  border: 1px solid rgba(239,68,68,0.15);
}

.suspended-message {
  font-size: 13px;
  color: #64748b;
  background: rgba(100,116,139,0.08);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid rgba(100,116,139,0.2);
  line-height: 1.6;
}

.provider-card.suspended-state {
  border-color: rgba(100,116,139,0.2);
  opacity: 0.80;
}

.provider-card.suspended-state .provider-name {
  color: var(--text-muted);
}

/* ── Best provider banner ───────────────────────────────── */
.best-banner {
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(99,102,241,0.1));
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.best-trophy { font-size: 32px; }

.best-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 4px;
}

.best-provider-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.best-amount {
  font-size: 18px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--green);
  font-weight: 600;
}

.best-diff {
  margin-left: auto;
  text-align: right;
}

.diff-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  font-family: 'JetBrains Mono', monospace;
}

.diff-label { font-size: 12px; color: var(--text-muted); }

/* ── Chart section ──────────────────────────────────────── */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.time-filters {
  display: flex;
  gap: 4px;
}

.time-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.time-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.time-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chart-container {
  position: relative;
  height: 280px;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 280px;
  color: var(--text-faint);
  font-size: 14px;
  flex-direction: column;
  gap: 8px;
}

.chart-empty .icon { font-size: 32px; opacity: 0.4; }

/* ── History table ──────────────────────────────────────── */
.history-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.history-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.history-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: rgba(255,255,255,0.02); }

td {
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

td.best-cell {
  color: var(--green);
  font-weight: 600;
}

td.muted-cell { color: var(--text-faint); }

/* ── Footer ─────────────────────────────────────────────── */
.footer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,14,26,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 12px 24px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--text-faint);
}

.next-update {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.countdown {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-light);
  font-weight: 600;
}

/* ── Loading skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  height: 20px;
}

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

/* ── Toast notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  max-width: 320px;
}

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

/* ── Utilities ──────────────────────────────────────────── */
.flex  { display: flex; }
.gap-8 { gap: 8px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-gold   { color: var(--gold); }
.text-accent { color: var(--accent-light); }

.monospace { font-family: 'JetBrains Mono', monospace; }

@media (max-width: 640px) {
  .amount-value { font-size: 28px; }
  .best-banner  { flex-direction: column; align-items: flex-start; }
  .best-diff    { margin-left: 0; text-align: left; }
}
