/* ==========================================
   Design System & Variáveis de Estilo
   ========================================== */
:root {
  --bg-color-deep: #050508;
  --bg-color-card: rgba(10, 10, 15, 0.75);
  --border-color: #ffffff;
  --text-color: #ffffff;
  --text-muted: #b0b0b8;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --glow-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
  --glow-shadow-hover: 0 0 20px rgba(255, 255, 255, 0.7);
  --focus-ring: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color-deep);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  /* Fundo estrelado gerado via CSS */
  background-image: 
    radial-gradient(1px 1px at 25px 35px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 50px 100px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 125px 150px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 200px 80px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 300px 250px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 400px 120px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2.5px 2.5px at 500px 350px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 600px 50px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 700px 180px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 800px 300px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 900px 110px, #ffffff, rgba(0,0,0,0));
  background-size: 550px 550px;
}

/* Esconder elementos visualmente para leitores de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Container Principal */
.app-container {
  width: 90%;
  max-width: 520px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

/* Título */
.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-color);
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Grupos de Input (Dropdowns) */
.input-group {
  width: 100%;
  margin-bottom: 16px;
}

select {
  width: 100%;
  padding: 12px 16px;
  background-color: black;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font-family);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  /* Personalização discreta da seta */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

select:focus {
  border-color: var(--text-color);
  box-shadow: var(--focus-ring);
}

/* Container do Editor */
.editor-container {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  background-color: var(--bg-color-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(10px);
}

/* Editor de Texto */
textarea {
  width: 100%;
  height: 280px;
  background-color: rgba(0, 0, 0, 0.4);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  font-family: var(--font-family);
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

textarea:focus {
  box-shadow: var(--focus-ring);
}

/* Estilização da barra de rolagem */
textarea::-webkit-scrollbar {
  width: 8px;
}
textarea::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}
textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
}
textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* Botões */
.btn {
  background-color: black;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 24px;
  font-size: 0.95rem;
  font-family: var(--font-family);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  outline: none;
  box-shadow: var(--glow-shadow);
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn:hover, .btn:focus-visible {
  box-shadow: var(--glow-shadow-hover);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  box-shadow: var(--glow-shadow-hover), var(--focus-ring);
}

/* Linha de botões principais */
.button-row-main {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 20px;
}

/* Linha de botões secundários */
.button-row-actions {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row-actions .btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 0.85rem;
  min-width: 100px;
}

/* Mensagem de Status */
.status-msg {
  width: 100%;
  margin-bottom: 12px;
  font-size: 0.85rem;
  text-align: left;
  min-height: 20px;
  color: var(--text-muted);
}
.status-msg.error {
  color: #ff6b6b;
  font-weight: 600;
}
.status-msg.success {
  color: #51cf66;
  font-weight: 600;
}

/* Modais / Diálogos */
.modal {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #0d0d13;
  color: var(--text-color);
  padding: 24px;
  margin: auto;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
  outline: none;
}

.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-title {
  font-size: 1.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.ficha-dados {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
}

.ficha-dados p {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.ficha-dados strong {
  color: var(--text-muted);
  font-weight: 400;
}

.ficha-dados span {
  font-weight: 600;
  text-align: right;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-close {
  padding: 6px 16px;
  font-size: 0.85rem;
}

/* Responsividade */
@media (max-width: 480px) {
  .button-row-actions {
    flex-direction: column;
  }
  .button-row-actions .btn {
    width: 100%;
  }
}
