/* CSS Variables */
:root {
  --color-bg: #0f0f12;
  --color-surface: #1a1a1f;
  --color-border: #2a2a32;
  --color-text: #e8e8ed;
  --color-text-muted: #8a8a96;
  --color-accent: #6366f1;
  --color-accent-hover: #818cf8;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* Header */
header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.25rem;
}

nav a:hover {
  color: var(--color-accent);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lang-select {
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}

/* Ad slots */
.ad-slot {
  min-height: 90px;
  background: var(--color-border);
  border-radius: var(--radius);
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.ad-mid {
  min-height: 280px;
  margin: 2rem 0;
}

/* Main */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

article {
  padding: 0;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.hero-description {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin: 0 0 2rem;
}

/* Format toggle */
.format-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.format-btn {
  flex: 1;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.format-btn:hover {
  border-color: var(--color-accent);
}

.format-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-accent);
  background: rgba(99, 102, 241, 0.08);
}

.drop-text {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
}

.drop-text span {
  color: var(--color-accent);
  text-decoration: underline;
}

.drop-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* Loading & Error */
.loading-state,
.error-message {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: var(--radius);
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-muted);
}

.error-message {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-error);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Result section */
.result-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.preview-container {
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  max-height: 400px;
}

.preview-container img {
  display: block;
  max-width: 100%;
  max-height: 400px;
  margin: 0 auto;
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.download-row label {
  flex: 0 0 auto;
}

.download-row input[type="text"] {
  flex: 1;
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

.primary-btn {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

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

/* Info sections */
.info-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.info-section h2 {
  color: var(--color-text);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.info-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.info-section p {
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

/* Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.step p {
  width: 100%;
  margin: 0.5rem 0 0;
  padding-left: 48px;
}

/* Comparison table */
.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.comparison-table th {
  background: var(--color-surface);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.comparison-table td:first-child {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

.comparison-table td {
  color: var(--color-text-muted);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

/* Use cases */
.use-cases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.use-case {
  padding: 1.25rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.use-case h3 {
  color: var(--color-text);
}

.use-case p {
  margin: 0;
}

/* Legal page */
/* Breadcrumb */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

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

.breadcrumb a:hover {
  text-decoration: underline;
}

.legal-page h1,
.faq-page h1 {
  margin-bottom: 0.25rem;
}

.legal-updated {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin: 0 0 2rem;
}

.legal-section {
  margin-bottom: 2.5rem;
}

.legal-section h2 {
  color: var(--color-text);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.legal-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 1.5rem 0 0.5rem;
}

.legal-section p {
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.legal-section ul {
  color: var(--color-text-muted);
  padding-left: 1.5rem;
  margin: 0 0 0.75rem;
}

.legal-section li {
  margin-bottom: 0.4rem;
}

.legal-section a {
  color: var(--color-accent);
  text-decoration: underline;
}

.legal-section a:hover {
  color: var(--color-accent-hover);
}

/* FAQ page */
.faq-page h1 {
  margin-bottom: 0.25rem;
}

.faq-intro {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  margin: 0 0 2rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item summary:hover {
  color: var(--color-accent);
}

.faq-item p {
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
  padding: 0 1.25rem;
}

.faq-item p:first-of-type {
  padding-top: 0.25rem;
}

.faq-item p:last-child {
  margin-bottom: 1.25rem;
}

/* Footer */
footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

footer a:hover {
  color: var(--color-accent);
}

footer .ad-slot {
  max-width: 728px;
  margin: 0 auto 1rem;
}

/* Mobile */
@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .drop-zone {
    padding: 2rem 1rem;
  }

  .format-toggle {
    flex-direction: column;
  }

  .download-row {
    flex-direction: column;
    align-items: stretch;
  }

  .step p {
    padding-left: 0;
  }

  .use-cases {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    font-size: 0.85rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.6rem 0.75rem;
  }
}
