/* style.css */
:root {
  --cor-principal: #1e40af;
  --cor-destaque: #3b82f6;
  --cor-sucesso: #16a34a;
  --cor-atencao: #d97706;
  --cor-perigo: #dc2626;
  --cor-fundo: #f9fafb;
  --cor-texto: #1f2937;
  --cor-texto-secundario: #4b5563;
  --borda: #e5e7eb;
  --raio: 12px;
  --transicao: all 0.25s ease;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--cor-fundo);
  color: var(--cor-texto);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header {
  text-align: center;
  margin: 1.5rem 0 2rem;
}

header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--cor-principal);
  margin-bottom: 0.5rem;
}

header p {
  color: var(--cor-texto-secundario);
  font-size: 1rem;
}

#wordCount {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* === Formulário de busca === */
.search-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  font-size: 1.125rem;
  outline: none;
  transition: var(--transicao);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-input:focus {
  border-color: var(--cor-destaque);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  min-height: 56px;
}

.search-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Responsivo: botão "Buscar" ocupa 100% em celulares */
@media (max-width: 640px) {
  .search-form {
    flex-direction: column;
  }
  .search-btn {
    width: 100%;
    padding: 1rem;
    justify-content: center;
  }
}

/* === Resultado === */
#result {
  min-height: 200px;
  margin-bottom: 2rem;
}

.result-card {
  background: white;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06);
  transition: var(--transicao);
}

.result-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
}

.tag {
  display: inline-block;
  background: #dbeafe;
  color: var(--cor-principal);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.result-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
  color: var(--cor-texto);
}

.result-translation {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cor-destaque);
  margin-bottom: 1.25rem;
}

/* === Botões de ação === */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.25rem 0;
}

.action-btn {
  flex: 1;
  min-width: 130px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  color: white;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Botão Copiar — mais legível */
.copy-btn {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: white;
}

.copy-btn:hover {
  background: linear-gradient(135deg, #374151, #1f2937);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(55, 65, 81, 0.3);
}

/* Botão WhatsApp */
.whatsapp-btn {
  background: linear-gradient(135deg, #128c7e, #075e54);
}

.whatsapp-btn:hover {
  background: linear-gradient(135deg, #075e54, #043d37);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(7, 94, 84, 0.35);
}

/* Botão Link */
.link-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.link-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(59, 130, 246, 0.35);
}

/* Responsivo: empilhar botões em celulares */
@media (max-width: 640px) {
  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .action-btn {
    width: 100%;
    min-width: auto;
  }
}

/* === Sinônimos === */
.synonym-badge {
  display: inline-block;
  background: #dbeafe;
  color: var(--cor-principal);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.example-box {
  background: #f9fafb;
  border-left: 3px solid var(--cor-destaque);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}

/* === Footer === */
.footer {
  background: linear-gradient(135deg, var(--cor-principal), var(--cor-destaque));
  color: white;
  padding: 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
  margin-top: auto;
}

.footer a {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  text-decoration: underline;
  color: white;
}

/* === Botão flutuante da API (opcional, mas mantido) === */
#btn-api {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  transition: all 0.25s ease;
}

#btn-api:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
  background: linear-gradient(135deg, #43A047, #2E7D32);
}

/* === Modal da API === */
#modal-api {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

#modal-api .content {
  background: white;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: auto;
  border-radius: 12px;
  padding: 1.5rem;
  font-family: 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

#modal-api h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--cor-principal);
}

#modal-api h3 {
  font-size: 1.125rem;
  margin: 1.25rem 0 0.5rem;
  color: #374151;
}

#modal-api pre {
  background: #f4f4f4;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-size: 0.9375rem;
}

#modal-api code {
  background: #f0f0f0;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9375rem;
}

#modal-api button {
  background: var(--cor-perigo);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 1rem;
  font-weight: 600;
}

#modal-api button:hover {
  background: #b91c1c;
}

/* === Alertas === */
.alert {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--raio);
  font-size: 1.125rem;
}

.alert-yellow {
  background: #fef9c3;
  border: 1px solid #fde047;
  color: #92400e;
}

.alert-red {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* === Página Sobre (estilos extras) === */
.prose {
  line-height: 1.7;
  color: #374151;
}
.prose h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  color: var(--cor-principal);
}
.prose p, .prose li {
  margin-bottom: 0.75rem;
}
.prose a {
  color: var(--cor-destaque);
  text-decoration: underline;
}

/* === Responsividade geral === */
@media (max-width: 640px) {
  header h1 {
    font-size: 1.5rem;
  }
  .result-title {
    font-size: 1.5rem;
  }
  .result-translation {
    font-size: 1.25rem;
  }
}

/* === Modal Sobre === */
#modal-sobre {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

#modal-sobre .content {
  background: white;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow: auto;
  border-radius: 12px;
  padding: 1.5rem;
  font-family: 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  line-height: 1.6;
}

#modal-sobre h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--cor-principal);
}

#modal-sobre h3 {
  font-size: 1.125rem;
  margin: 1.25rem 0 0.5rem;
  color: #374151;
}

#modal-sobre p, #modal-sobre li {
  margin-bottom: 0.75rem;
  color: var(--cor-texto-secundario);
}

#modal-sobre ul {
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}

#modal-sobre a {
  color: var(--cor-destaque);
  text-decoration: underline;
}

#modal-sobre button {
  background: var(--cor-perigo);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 1rem;
  font-weight: 600;
}

#modal-sobre button:hover {
  background: #b91c1c;
}