:root {
  --bg-color: #0d0d0d;
  --surface-color: #1a1a1a;
  --surface-hover: #222;
  --border-color: #333;
  --primary-color: #4f7cff;
  --primary-hover: #3a63db;
  --text-main: #e0e0e0;
  --text-muted: #888;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.container {
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* --- DROPZONE --- */

.dropzone {
  height: 200px; /* Altura fixa */
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
}

.dropzone:hover {
  border-color: #555;
  background: rgba(255, 255, 255, 0.05);
}

.dropzone p {
  pointer-events: none;
  padding: 0 20px;
}

#preview {
  /* VOLTOU AO ORIGINAL: Respeita proporção da imagem */
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; 
  display: none;
}

#preview.active {
  display: block;
}

/* --- BOTÃO --- */

#uploadBtn {
  height: 46px;
  border-radius: 8px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

#uploadBtn:not(:disabled):hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

#uploadBtn:disabled {
  background: var(--border-color);
  color: #555;
  cursor: not-allowed;
  opacity: 0.7;
}

/* --- PROGRESSO & STATUS --- */

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress {
  width: 100%;
  height: 4px;
  background: #2a2a2a;
  border-radius: 999px;
  overflow: hidden;
}

.progress div {
  height: 100%;
  width: 0%;
  background: var(--primary-color);
  border-radius: 999px;
  transition: width 0.2s ease-out;
}

#status {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  min-height: 16px;
  color: var(--text-muted);
  text-align: center; /* CORREÇÃO: Centralizado */
  margin-top: 4px;
}

/* --- RESULTADO --- */

.result-container {
  display: flex;
  gap: 8px;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  pointer-events: none;
}

.result-container.show {
  height: 42px;
  opacity: 1;
  pointer-events: all;
  margin-top: 4px;
}

/* Visual mais limpo para parecer apenas um display de texto */
.result-container input {
  flex: 1;
  background: #111;
  border: 1px solid var(--border-color); /* Borda sutil */
  border-radius: 8px;
  padding: 0 12px;
  color: var(--primary-color);
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  outline: none;
}

#copyActionBtn {
  width: 80px;
  height: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #222;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

#copyActionBtn:hover {
  background: #333;
  border-color: #555;
}

#copyActionBtn.copied {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}