/* The hidden attribute's default `display: none` is a browser-stylesheet
   rule, which any of this file's own `display` declarations below silently
   overrides (author styles beat the browser default regardless of selector
   specificity) — so every element toggled via `.hidden = true/false` in JS
   needs this guard, or it stays visible/laid-out even while "hidden". */
[hidden] {
  display: none !important;
}

.doc2pdf-intro {
  padding: 56px 0 8px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, var(--lighter-background), var(--background) 70%);
}

.doc2pdf-intro h1 {
  color: var(--foreground);
  font-size: 2rem;
  margin-bottom: 8px;
}

.doc2pdf-intro .tagline {
  color: var(--light-foreground);
  font-size: 0.95rem;
}

.doc2pdf-panel {
  padding: 40px 0 80px;
}

.drop-zone {
  max-width: 560px;
  margin: 0 auto;
  border: 2px dashed var(--muted);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  color: var(--light-foreground);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background: var(--lighter-background);
}

.drop-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.doc2pdf-queue {
  max-width: 560px;
  margin: 20px auto 0;
  padding: 0;
  list-style: none;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--lighter-background);
  border: 1px solid var(--muted);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.queue-item-index {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dark-background);
  color: var(--light-foreground);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-item-name {
  flex: 1;
  min-width: 0;
  color: var(--foreground);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item-type {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.queue-item-controls {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
}

.queue-btn {
  background: var(--dark-background);
  color: var(--light-foreground);
  border: none;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.queue-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--dark-background);
}

.queue-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.queue-btn-remove:hover:not(:disabled) {
  background: var(--red);
  color: #fff;
}

.doc2pdf-actions {
  max-width: 560px;
  margin: 16px auto 0;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 10px 24px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--dark-background);
}

.btn-secondary {
  background: transparent;
  color: var(--light-foreground);
  border: 1px solid var(--muted);
  padding: 9px 23px; /* -1px to offset the border and match .btn-primary's box height */
}

.btn-primary:hover:not(:disabled),
.btn-secondary:hover:not(:disabled) {
  transform: scale(1.05);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.doc2pdf-status {
  max-width: 560px;
  margin: 20px auto 0;
  text-align: center;
  color: var(--light-foreground);
  font-size: 0.9rem;
}

.progress-track {
  max-width: 560px;
  margin: 12px auto 0;
  height: 6px;
  border-radius: 999px;
  background: var(--dark-background);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.15s ease;
}

.doc2pdf-result {
  max-width: 560px;
  margin: 24px auto 0;
  background: var(--lighter-background);
  border: 1px solid var(--muted);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.result-info {
  color: var(--foreground);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.download-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--dark-background);
  border-radius: 999px;
  padding: 10px 28px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.download-btn:hover {
  transform: scale(1.05);
  color: var(--dark-background);
}

/* Rendered off-screen (not display:none, since html2canvas can't rasterize
   an element that isn't actually laid out) so DOCX content can be measured
   and captured before being converted to PDF pages. */
.docx-render {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 700px;
  background: #ffffff;
  color: #111111;
  padding: 40px;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.5;
}

.docx-render img {
  max-width: 100%;
}

.doc2pdf-note {
  max-width: 560px;
  margin: 24px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
