/* md2pdf — App UI Styling */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #111827;
  color: #e5e7eb;
  min-height: 100vh;
  padding: 2rem;
}

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

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #f9fafb;
}

header p {
  color: #9ca3af;
  margin-top: 0.3rem;
}

main {
  max-width: 900px;
  margin: 0 auto;
}

/* Drop Zone */
#drop-zone {
  border: 2px dashed #4b5563;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #1f2937;
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: #6366f1;
  background: #1e1b4b;
}

.drop-zone-content svg {
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.drop-zone-content p {
  color: #9ca3af;
  font-size: 1rem;
}

/* File List */
#file-list {
  background: #1f2937;
  border-radius: 8px;
  margin-top: 1rem;
  padding: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
}

.file-item:hover {
  background: #374151;
}

.file-item .filename {
  font-size: 0.9rem;
  color: #d1d5db;
}

.file-item .remove-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 0.4rem;
  line-height: 1;
}

.file-item .remove-btn:hover {
  color: #ef4444;
}

/* Controls */
#controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  background: #1f2937;
  border-radius: 8px;
  padding: 0.8rem 1rem;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.controls-left label {
  font-size: 0.85rem;
  color: #9ca3af;
}

.controls-right {
  display: flex;
  gap: 0.6rem;
}

select {
  background: #374151;
  color: #e5e7eb;
  border: 1px solid #4b5563;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

button {
  background: #374151;
  color: #e5e7eb;
  border: 1px solid #4b5563;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover {
  background: #4b5563;
}

button.primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

button.primary:hover {
  background: #4338ca;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Preview */
#preview-container {
  margin-top: 1rem;
  background: #1f2937;
  border-radius: 8px;
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #374151;
}

#preview-filename {
  font-size: 0.85rem;
  color: #9ca3af;
}

#preview-frame {
  width: 100%;
  height: 600px;
  border: none;
  background: #fff;
}

/* File select for multi-file preview */
#file-select {
  font-size: 0.8rem;
}

/* Error bar */
#error-bar {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: #7f1d1d;
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.9rem;
}

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