/* Theme variables */
:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --text: #1a1a1a;
  --muted: #666666;
  --border: #e5e5e5;
  --accent: #0066d6;
  --btn-bg: #000000;
  --btn-text: #ffffff;
  --secondary-bg: #ffffff;
  --error-bg: #fee;
  --error-border: #fcc;
  --error-text: #c33;
}

/* Dark theme (applied via data-theme="dark" on <html> or <body>) */
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #0f1724;
  --text: #e6eef8;
  --muted: #9aa6bf;
  --border: #223047;
  --accent: #1e90ff;
  --btn-bg: #111827;
  --btn-text: #ffffff;
  --secondary-bg: #0b1220;
  --error-bg: #3b1111;
  --error-border: #5a1a1a;
  --error-text: #ffb4b4;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.theme-toggle:focus {
  outline: 2px solid var(--accent);
}

/* Hero Section */
.hero {
  background: var(--surface);
  padding: 80px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 800px;
  margin: 0 auto;
}

/* Converter Section */
.converter {
  padding: 40px 0;
}

.converter-box {
  background: var(--surface);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.input-section {
  position: relative; /* for side-controls */
  padding-top: 8px;
}

.input-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.input-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  vertical-align: middle;
}

/* Side controls (top-right) */
.side-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 5;
}

.side-controls .btn {
  padding: 12px 24px; /* match main Convert button */
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.btn-upload {
  background: var(--secondary-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-copy {
  background: #6b7280;
  color: #fff;
  border-radius: 6px; /* match main Convert button */
  border: none;
}

.btn-download {
  background: linear-gradient(180deg, #0582ff, #0066d6);
  color: #fff;
  border-radius: 6px; /* match main Convert button */
  border: none;
}

textarea {
  width: 100%;
  min-height: 320px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  background: var(--secondary-bg);
  color: var(--text);
}

textarea:focus {
  outline: none;
  border-color: var(--text);
}

.buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-convert {
  background: var(--secondary-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-convert:hover {
  filter: brightness(0.9);
}

.btn-secondary {
  background: var(--secondary-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Features Section */
.features {
  padding: 80px 0;
  background: var(--surface);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.section-header p {
  font-size: 18px;
  color: var(--muted);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature {
  background: var(--surface);
  padding: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.feature h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.feature p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* Info Sections */
.info-section {
  padding: 80px 0;
}

.info-section h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
}

.info-section p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.info-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.info-card p {
  font-size: 15px;
  color: var(--muted);
}
.pricing-table {
  margin: 40px 0;
  overflow-x: auto;
}
.pricing-table table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.pricing-table th,
.pricing-table td {
  padding: 12px 16px;
  border: 1px solid var(--border);
}
.pricing-table th {
  background-color: var(--surface);
  font-weight: 600;
}

/* How to Use */
.steps {
  padding: 80px 0;
  background: var(--surface);
}

.step {
  margin-bottom: 40px;
}

.step h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.step p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
}

/* FAQ */
.faq {
  padding: 80px 0;
}

.faq-item {
  margin-bottom: 32px;
}

.faq-item h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.faq-item p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
}

.error-msg {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

@media (max-width: 768px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 36px;
  }
  .side-controls {
    position: static;
    margin-top: 8px;
    justify-content: flex-end;
  }
}

footer {
  background: var(--surface);
  padding: 80px 0;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-logo p {
  font-size: 15px;
  color: var(--muted);
  margin-top: 12px;
  max-width: 300px;
}
.footer-links h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.footer-links ul {
  list-style: none;
}
.footer-links li {
  margin-bottom: 8px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--text);
}
.footer-bottom {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.blog-post-preview {
  background: var(--surface);
  padding: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.blog-post-preview h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.blog-post-preview p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.blog-post-preview a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
