:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #9ca3af;
  --accent: #22c55e;
  --accent-2: #22c55e;
  --text: #f8fafc;
  --border: #1f2937;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand .logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.3px;
}

.brand .logo span {
  color: var(--accent);
}

.nav a {
  margin-left: 16px;
  font-weight: 600;
}

.hero {
  padding: 48px 0;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  margin: 0 0 8px;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  margin: 0 0 24px;
  color: var(--muted);
}

.dropzone {
  background: var(--card);
  border: 2px dashed var(--border);
  padding: 28px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  transition: 0.2s ease border-color, 0.2s ease background;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.08);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #232946;
  box-shadow: 0 0 0 3px var(--accent, #4f46e5);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dz-icon {
  font-size: 48px;
  margin-bottom: 12px;
  transition: transform 0.2s;
}

.dropzone.dragover .dz-icon {
  transform: scale(1.15) rotate(-8deg);
  color: var(--accent);
}

.dz-title {
  font-size: 18px;
  margin: 0 0 4px;
}

.dz-sub {
  margin: 0 0 6px;
}

.dz-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Updated actions styling for center alignment */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  width: 100%;
}

/* Base button styles */
button {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
  font-size: 14px;
  min-width: 120px;
}

/* Primary button (Convert) */
button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1em;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px 0 rgba(34, 197, 94, 0.08);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  padding: 12px 24px;
  min-width: 140px;
}

button.primary:hover,
button.primary:focus {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 24px 0 rgba(34, 197, 94, 0.14);
  transform: translateY(-2px) scale(1.03);
  color: #fff;
}

button.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Ghost button (Reset) */
button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  min-width: 100px;
}

button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(34, 197, 94, 0.05);
}

/* Browse button styling */
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  font-size: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.link-btn:hover,
.link-btn:focus {
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-2);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.link-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Add icon to browse button */
.link-btn::before {
  content: "📁";
  font-size: 14px;
  margin-right: 2px;
}

button:active,
summary.section-title:active {
  transform: scale(0.97);
}

.status {
  min-height: 24px;
  margin: 16px auto;
  max-width: 560px;
  color: var(--text);
  opacity: 1;
  transition: opacity 0.3s ease;
  text-align: center;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
}

.status.error {
  color: #fda4af;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.ad-placeholder {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

.ad-box {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  min-width: 300px;
  text-align: center;
  color: var(--muted);
}

.section,
.info-section {
  border-top: 1px solid var(--border);
  margin-top: 1em;
  padding-top: 1em;
}

.steps {
  margin: 0;
  padding-left: 18px;
}

.steps li {
  margin-bottom: 0.5em;
  padding-left: 0.5em;
  border-left: 3px solid var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  color: var(--muted);
  text-align: center;
}

/* File info styling */
.file-info {
  margin: 16px 0;
  text-align: center;
}

.file-preview {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.preview-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-icon {
  font-size: 24px;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preview-name {
  font-weight: bold;
  margin: 0;
  color: var(--text);
}

.preview-size {
  font-size: 0.9em;
  color: var(--muted);
  margin: 0;
}

.progress-container {
  width: 100%;
  max-width: 500px;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 16px auto;
  box-sizing: border-box;
}

.progress-bar {
  width: 100%;
  height: 100%;
}

.progress-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease-in-out;
  box-sizing: border-box;
}

.spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

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

@media (max-width: 600px) {
  .hero h1 {
    font-size: 28px;
  }
  .nav a {
    margin-left: 12px;
    font-size: 14px;
  }
  .dropzone {
    padding: 20px;
    min-height: 180px;
  }
  .dz-icon {
    font-size: 36px;
    margin-bottom: 8px;
  }
  .dz-title {
    font-size: 16px;
    margin: 0 0 4px;
  }
  .actions {
    flex-direction: column;
    gap: 8px;
  }
  button {
    width: 100%;
    max-width: 280px;
  }
  .container {
    padding: 8px;
  }
  .dropzone {
    padding: 12px;
  }
  .info-section,
  .section {
    padding-top: 1em;
    margin-top: 1em;
  }
  .file-preview {
    margin: 6px 0;
  }
}

/* Highlight expanded details section */
details.info-section[open] {
  background: #1e293b;
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  margin-bottom: 1.5em;
  padding: 1em 1.5em 1em 1.5em;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
  transition: background 0.2s, box-shadow 0.2s;
}

/* Add spacing between summary and content */
details.info-section[open] > summary.section-title {
  margin-bottom: 0.75em;
}

/* Make summary stand out and clickable */
details > summary.section-title {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.15em;
  outline: none;
  transition: color 0.2s;
}

details > summary.section-title:hover,
details > summary.section-title:focus {
  color: var(--accent, #22c55e);
}

/* FAQ Section Styles */
details.info-section > details {
  margin: 0.5em 0 0.5em 1.2em;
  background: #111827;
  border-radius: 6px;
  border: 1px solid var(--border, #334155);
  padding: 0.5em 1em;
  transition: background 0.2s;
}

details.info-section > details[open] {
  background: #232946;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.04);
}

details.info-section > details > summary {
  cursor: pointer;
  font-weight: 500;
  outline: none;
  transition: color 0.2s;
  padding: 0.25em 0;
}

details.info-section > details > summary:hover,
details.info-section > details > summary:focus {
  color: var(--accent-2, #22c55e);
}

details.info-section > details > p {
  margin: 0.5em 0 0.5em 0;
  color: var(--text, #f8fafc);
  font-size: 1em;
}

body {
  font-size: 1.08em;
  line-height: 1.7;
  background: linear-gradient(135deg, #0f172a 0%, #232946 100%);
}

.section-title,
.info-section > summary.section-title {
  letter-spacing: 0.01em;
}

details[open] > *:not(summary) {
  animation: fadeIn 0.4s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.loading {
  margin: 12px auto;
  text-align: center;
  color: var(--accent, #22c55e);
  font-weight: 600;
  font-size: 1.1em;
  letter-spacing: 0.03em;
  background: rgba(34, 197, 94, 0.07);
  border-radius: 8px;
  padding: 8px 18px;
  box-shadow: 0 2px 8px 0 rgba(34, 197, 94, 0.07);
}