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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

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

header h1 {
  font-size: 2rem;
  color: #1a365d;
}

.subtitle {
  color: #666;
  margin-top: 0.5rem;
}

/* Drop Zone */
.drop-zone {
  border: 3px dashed #cbd5e0;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #4299e1;
  background: #ebf8ff;
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.drop-zone p {
  font-size: 1.1rem;
  color: #4a5568;
}

.drop-hint {
  font-size: 0.9rem !important;
  color: #a0aec0 !important;
  margin-top: 0.5rem;
}

/* Metadata Form */
.metadata-form {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.metadata-form h3 {
  color: #2d3748;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #4a5568;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

/* Loading */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #4299e1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading-section {
  text-align: center;
  padding: 3rem;
}

/* Results */
.results-header {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.results-header h2 {
  color: #1a365d;
  margin-bottom: 0.5rem;
}

.result-info {
  display: flex;
  gap: 1.5rem;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.download-buttons {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: #2b6cb0;
  color: #fff;
}

.btn-primary:hover {
  background: #2c5282;
}

.btn-secondary {
  background: #48bb78;
  color: #fff;
}

.btn-secondary:hover {
  background: #38a169;
}

.btn-outline {
  background: transparent;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}

.btn-outline:hover {
  background: #f7fafc;
}

/* Preview */
.preview-container {
  margin-top: 1.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.preview-container h3 {
  padding: 1rem 1.5rem;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
}

.preview-content {
  padding: 2rem 2.5rem;
  font-family: 'Times New Roman', Times, serif;
  font-size: 12pt;
  line-height: 1.5;
  max-height: 70vh;
  overflow-y: auto;
}

/* Preview ABNT styles */
.preview-content .cover-preview {
  text-align: center;
  padding: 2rem 0 3rem;
}

.preview-content .institution {
  font-weight: bold;
  margin-bottom: 3rem;
}

.preview-content .doc-title {
  font-weight: bold;
  font-size: 14pt;
}

.preview-content .location {
  margin-top: 3rem;
}

.preview-content h2, .preview-content h3, .preview-content h4, .preview-content h5 {
  font-family: 'Times New Roman', Times, serif;
  margin: 1.5rem 0 0.8rem;
}

.preview-content .bold { font-weight: bold; }
.preview-content .italic { font-style: italic; }
.preview-content .center { text-align: center; }
.preview-content .caps { text-transform: uppercase; }

.preview-content .body-text {
  text-indent: 1.25cm;
  margin-bottom: 0.3rem;
}

.preview-content .long-quote {
  margin: 1rem 0 1rem 4cm;
  font-size: 10pt;
  line-height: 1.2;
  border: none;
  padding: 0;
}

.preview-content .abnt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 10pt;
}

.preview-content .abnt-table th,
.preview-content .abnt-table td {
  border: 1px solid #333;
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.preview-content .abnt-table th {
  font-weight: bold;
  background: #f7fafc;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }
  .download-buttons {
    flex-direction: column;
  }
}
