/* Official Light Theme Design System for Universal Document™ */

:root {
  --ud-ink:      #1e2d3d;
  --ud-ink-2:    #2d4060;
  --ud-paper:    #f8f6f0;
  --ud-paper-2:  #f0ede4;
  --ud-paper-3:  #e2dbcc;
  --ud-gold:     #c9a84c;
  --ud-gold-2:   #bfa044;
  --ud-gold-3:   #fff8e6;
  --ud-teal:     #0a7a6a;
  --ud-teal-2:   #e0f5f0;
  --ud-border:   #e8e3d9;
  --ud-border-2: #dbd4c4;
  --ud-muted:    #6b7a8a;
  --ud-danger:   #e24b4a;
  --ud-success:  #1d9e75;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--ud-paper);
  color: var(--ud-ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Brand Header */
header {
  height: 56px;
  background: var(--ud-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left a {
  text-decoration: none;
  font-size: 18px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  gap: 18px;
  align-items: center;
}

nav a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

nav a:hover {
  color: #ffffff;
}

nav .active-nav {
  color: var(--ud-gold);
  font-weight: 700;
}

/* Page Layout */
main {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
  flex-grow: 1;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ud-ink);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.hero p {
  color: var(--ud-muted);
  font-size: 1.1rem;
}

/* Card */
.converter-card {
  background: #ffffff;
  border: 0.5px solid var(--ud-border);
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Drop Zone */
.dropzone {
  border: 1.5px dashed var(--ud-border-2);
  background: var(--ud-paper-2);
  border-radius: 12px;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--ud-teal);
  background: var(--ud-teal-2);
}

.dropzone-icon {
  font-size: 3rem;
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ud-ink);
}

.dropzone-desc {
  font-size: 0.875rem;
  color: var(--ud-muted);
}

/* Format settings */
.format-settings {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.select-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ud-muted);
}

select {
  background: #ffffff;
  border: 1px solid var(--ud-border);
  color: var(--ud-ink);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}

select:focus {
  border-color: var(--ud-teal);
}

.arrow-icon {
  font-size: 1.25rem;
  color: var(--ud-muted);
  margin-top: 1.25rem;
}

/* Raw Toggle */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  margin-bottom: 1.75rem;
  border-top: 0.5px solid var(--ud-border);
  border-bottom: 0.5px solid var(--ud-border);
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toggle-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ud-ink);
}

.toggle-desc {
  font-size: 0.8rem;
  color: var(--ud-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--ud-paper-3);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--ud-teal);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Button */
.btn-convert {
  width: 100%;
  background: var(--ud-gold);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(200,150,10,0.22);
}

.btn-convert:hover:not(:disabled) {
  background: #a67808;
  box-shadow: 0 4px 16px rgba(200,150,10,0.32);
}

.btn-convert:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Progress / Status views */
.status-container {
  display: none;
  text-align: center;
  padding: 2rem 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ud-paper-3);
  border-radius: 50%;
  border-top-color: var(--ud-teal);
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto 1.5rem;
}

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

.status-text {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--ud-ink);
}

.status-sub {
  font-size: 0.875rem;
  color: var(--ud-muted);
}

.error-card {
  display: none;
  background: rgba(226, 75, 74, 0.1);
  border: 1px solid rgba(226, 75, 74, 0.2);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.5rem;
  color: var(--ud-danger);
  font-size: 0.95rem;
  text-align: left;
}

.error-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Brand Footer */
footer {
  border-top: 0.5px solid var(--ud-border);
  padding: 40px 24px 32px;
  background: var(--ud-paper-2);
  margin-top: auto;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ud-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--ud-ink);
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ud-muted);
  margin-bottom: 10px;
}

.footer-text a {
  color: var(--ud-muted);
  text-decoration: none;
}

.footer-subtext {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ud-border-2);
  margin-bottom: 4px;
}

.file-info {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--ud-paper-2);
  border: 1px solid var(--ud-border);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.75rem;
}

.file-info-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-icon {
  font-size: 1.25rem;
}

.file-name {
  font-weight: 700;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.8rem;
  color: var(--ud-muted);
}

.btn-remove-file {
  background: none;
  border: none;
  color: var(--ud-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.btn-remove-file:hover {
  color: var(--ud-danger);
}
