:root {
  /* Default = tema escuro */
  --bg: #0b0f14;
  --card: #121824;
  --text: #e7eefc;
  --muted: #a9b7d0;
  --accent: #6ea8fe;
  --bad: #ff6b6b;
  --border: rgba(255,255,255,0.10);
  --shadow: rgba(0,0,0,0.35);
}

/* Tema claro */
:root[data-theme="light"] {
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #4a5a73;
  --accent: #2563eb;
  --bad: #dc2626;
  --border: rgba(0,0,0,0.10);
  --shadow: rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
}

.container { max-width: 1050px; margin: 0 auto; padding: 22px; }

.header-row{
  display:flex;
  gap:14px;
  align-items:flex-start;
  justify-content:space-between;
}

header h1 { margin: 0 0 6px; font-size: 28px; }
.sub { margin: 0; color: var(--muted); line-height: 1.35; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 18px var(--shadow);
}

.card.full { grid-column: 1 / -1; }

h2 { margin: 0 0 12px; font-size: 18px; }

label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 13px;
}

textarea, input[type="number"], input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  outline: none;
}

:root[data-theme="light"] textarea,
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] input[type="file"] {
  background: rgba(0,0,0,0.03);
}

textarea { resize: vertical; min-height: 100px; }

.row { display: flex; gap: 10px; margin-top: 12px; }
.col { flex: 1; }

/* ===== Botões (base) ===== */
button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--accent);
  color: #081019;
  font-weight: 700;
  cursor: pointer;
}

/* Secondary (base) */
button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

button:hover { filter: brightness(1.05); }

/* ===== Ajustes de botões no MODO CLARO (visual bonito e legível) ===== */

/* Botões primários (Ouvir/Traduzir) */
:root[data-theme="light"] button:not(.secondary) {
  color: #fff;               /* texto branco no azul */
  border-color: transparent; /* sem borda estranha */
}

/* Botões secondary (Baixar MP3 / Copiar / botão do tema) */
:root[data-theme="light"] button.secondary {
  color: var(--text);                 /* texto escuro */
  background: rgba(0,0,0,0.03);       /* corpo leve */
  border-color: rgba(0,0,0,0.12);     /* borda visível */
}

:root[data-theme="light"] button.secondary:hover {
  background: rgba(0,0,0,0.06);
}

/* Hover no escuro para botões secondary (opcional, fica melhor) */
:root:not([data-theme="light"]) button.secondary:hover {
  background: rgba(255,255,255,0.06);
}

/* ===== Player ===== */
.player { width: 100%; margin-top: 12px; }

/* ===== Status ===== */
.status {
  margin-top: 10px;
  color: var(--muted);
  min-height: 18px;
}

.status.bad { color: var(--bad); }

/* ===== Tabela ===== */
.table-wrap { overflow-x: auto; margin-top: 10px; }

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th { color: var(--muted); font-weight: 600; }

code { color: var(--accent); }

.hint { color: var(--muted); margin: 12px 0 0; }

.footer { color: var(--muted); padding-bottom: 30px; }

/* ===== Botão de tema (emoji) ===== */
.theme-btn {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 12px;
  user-select: none;
}

/* ===== Responsivo ===== */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .header-row { align-items:flex-start; }
}
