/* Capitais — Ranking Histórico ENEM 2015-2024 */

/* ===== NAV HOME (padrão do site) ===== */
.nav-home {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  z-index: 1000;
}

.nav-home button {
  background-color: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 44%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  padding: 0;
}

.nav-home button:hover {
  background-color: rgba(78, 144, 118, 1);
  transform: scale(1.05);
}

.brasil-icon {
  width: 50px;
  height: 50px;
  filter: brightness(0) invert(1);
}

/* ===== BASE ===== */
body {
  font-family: var(--font-stack);
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background-color: #fff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* ===== PAGE HEADER ===== */
.page-header {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4E9076;
  margin-bottom: 6px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #222;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  font-size: 0.9rem;
  color: #888;
  margin: 0;
}

/* ===== CAPITAL SELECTOR ===== */
.capital-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 24px;
}

.capital-btn {
  font-family: var(--font-stack);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f5f5f5;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.capital-btn:hover {
  background: #e8e8e8;
  border-color: rgba(78, 144, 118, 0.4);
  color: #4E9076;
}

.capital-btn.active {
  background: #4E9076 !important;
  color: #fff !important;
  border-color: #4E9076 !important;
  box-shadow: 0 2px 8px rgba(78, 144, 118, 0.35);
}

/* ===== CHART SECTION ===== */
.chart-card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

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

.chart-uf-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.chart-uf-sub {
  font-size: 0.82rem;
  color: #888;
  margin: 4px 0 0;
}

.chart-uf-sub .badge {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 600;
}

.badge-positive { color: hsl(152, 60%, 40%); }
.badge-negative { color: hsl(4, 80%, 55%); }

.chart-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.78rem;
  color: #888;
}

.chart-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.dot-positive { background: hsl(152, 60%, 40%); opacity: 0.88; }
.dot-negative { background: hsl(4, 80%, 55%); opacity: 0.88; }
.dot-trend { background: #999; opacity: 0.6; }

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

/* ===== DATA TABLE ===== */
.table-wrap {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead {
  background: #f8f8f8;
  border-bottom: 2px solid #eee;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.data-table tbody tr:hover td {
  background: #fafafa;
}

.data-table .td-year {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #333;
}

.data-table .td-num {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

.data-table .td-dist {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dist-positive { color: hsl(152, 60%, 40%); }
.dist-negative { color: hsl(4, 80%, 55%); }

/* ===== SOURCE ===== */
.source {
  text-align: center;
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 8px;
}

/* ===== LOADING ===== */
#loading {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body { padding: 12px; }
  .container { padding: 16px; }
  .page-header h1 { font-size: 1.3rem; }
  .capital-btn { font-size: 0.7rem; padding: 5px 8px; }
  .chart-container { height: 320px; }
  .chart-card { padding: 16px; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 0.78rem; }
  .nav-home { left: 10px; }
  .nav-home button { width: 44px; height: 44px; }
  .brasil-icon { width: 36px; height: 36px; }
  .chart-card-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .capital-grid { gap: 4px; }
  .capital-btn { font-size: 0.65rem; padding: 4px 6px; }
  .chart-container { height: 280px; }
}
