@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Modern Dark SaaS Palette */
  --bg: #09090b;
  /* Zinc 950 */
  --surface: #18181b;
  /* Zinc 900 */
  --surface-hover: #27272a;
  /* Zinc 800 */
  --border: #27272a;
  --border-focus: #52525b;

  --text: #f4f4f5;
  --text-muted: #a1a1aa;

  /* Brand Accents */
  --primary: #8b5cf6;
  /* Vibrant Violet */
  --primary-hover: #7c3aed;
  --accent: #10b981;
  /* Emerald Green for success/trust */

  /* UI details */
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
  --glow: 0 0 40px rgba(139, 92, 246, 0.15);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ──────────────────────────────── */
.top-nav {
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.2rem;
  background: var(--primary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.logo-text {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
}

.trust-badge {
  font-size: 0.85rem;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
}

/* ── Layout & Typography ─────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero .highlight {
  background: linear-gradient(135deg, var(--primary), #d946ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── AD PLACEHOLDERS ─────────────────────────── */
.ad-placeholder {
  background: repeating-linear-gradient(45deg,
      var(--surface),
      var(--surface) 10px,
      var(--bg) 10px,
      var(--bg) 20px);
  border: 1px dashed var(--border-focus);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0 auto 40px auto;
}

.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
}

.ad-rectangle {
  width: 100%;
  max-width: 300px;
  height: 250px;
}

/* ── App Container (The Converter) ───────────── */
.app-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* ── Upload Area ────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border-focus);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(24, 24, 27, 0.5);
  transition: all 0.2s ease;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.05);
}

.upload-icon-wrap {
  color: var(--primary);
  margin-bottom: 16px;
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.upload-text span {
  color: var(--primary);
}

.upload-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

#file-input {
  display: none;
}

/* ── Global Settings & Results ──────────────── */
.global-format-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  border: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.global-format-tags {
  display: flex;
  gap: 8px;
}

.global-format-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.global-format-tag:hover {
  background: var(--surface-hover);
}

.global-format-tag.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ── Converting busy state & Label ───────────────────── */
.global-format-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 165px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.global-format-label::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-focus);
  border-top-color: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0;
}

.global-format-bar.converting .global-format-tag {
  opacity: 0.4;
  pointer-events: none;
}

.global-format-bar.converting .global-format-label::before {
  opacity: 1;
  animation: spin 0.7s linear infinite;
}

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

.batch-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: 0.2s;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-focus);
  color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-hover);
}

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

/* Results Grid Items */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.result-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.result-status {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.result-preview {
  width: 100%;
  height: 140px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 4px;
  background: #000;
}

.result-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.format-tags {
  display: none;
  /* Hidden since we use the global bar */
}

.result-actions .btn-download {
  width: 100%;
  padding: 8px;
  background: var(--surface-hover);
  color: var(--text);
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.result-actions .btn-download:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

/* ── Features Strip ─────────────────────────── */
.features-strip {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Info Sections & Accordions ─────────────── */
.info-section {
  margin-bottom: 60px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.how-step {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
}

.step-num {
  width: 40px;
  height: 40px;
  background: var(--surface-hover);
  color: var(--primary);
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.2rem;
}

.step-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.step-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Accordion FAQ */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}

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

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.faq-item summary::after {
  content: '+';
  color: var(--primary);
  font-size: 1.2rem;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-content {
  padding: 0 20px 20px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Footer ─────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a {
  color: var(--text);
  text-decoration: none;
  margin-top: 8px;
  display: inline-block;
}

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

/* Responsive Adjustments */
@media (max-width: 600px) {
  .app-container {
    padding: 20px;
  }

  .global-format-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .batch-actions {
    flex-direction: column;
  }
}