/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #1a1a25;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e8ed;
  --text-muted: #8888a0;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --error: #ef4444;
  --success: #22c55e;
  --radius: 8px;
  --max-width: 720px;
}

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

/* Language suggestion banner */
.lang-banner:not([hidden]) {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(245, 158, 11, 0.06);
  border-bottom: 1px solid rgba(245, 158, 11, 0.12);
}

.lang-banner a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.lang-banner a:hover {
  text-decoration: underline;
}

.lang-banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.lang-banner-close:hover {
  color: var(--text);
}

/* Nav */
header {
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-picker {
  position: relative;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
}

.lang-toggle:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.lang-globe {
  font-size: 1rem;
}

.lang-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.lang-dropdown.open {
  display: flex;
  flex-direction: column;
}

.lang-option {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition:
    background 0.15s,
    color 0.15s;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.lang-option.active {
  color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
}

.logo {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Tool card */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 48px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-row input:focus {
  border-color: var(--accent);
}

.input-row input::placeholder {
  color: var(--text-muted);
}

.input-row button {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.input-row button:hover {
  background: var(--accent-hover);
}

.input-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error */
.error {
  color: var(--error);
  margin-top: 12px;
  font-size: 0.9rem;
}

/* Loading */
#loading:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--text-muted);
}

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

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

/* Tracks */
#tracks-list h2 {
  font-size: 1rem;
  margin: 16px 0 8px;
  color: var(--text-muted);
}

.track-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.track-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-lang {
  font-weight: 500;
}

.track-auto {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.track-manual {
  color: var(--success);
  font-size: 0.8rem;
}

.track-buttons {
  display: flex;
  gap: 6px;
}

.dl-btn {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}

.dl-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* Content sections */
.content-section {
  margin-bottom: 40px;
}

.content-section h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

/* Steps */
.steps {
  padding-left: 20px;
}

.steps li {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.steps li strong {
  color: var(--text);
}

/* Format grid */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.format-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.format-card h3 {
  color: var(--accent);
  margin-bottom: 8px;
}

.format-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.format-best {
  margin-top: 8px;
  font-weight: 600;
  color: var(--text) !important;
  font-size: 0.85rem !important;
}

/* Use case grid */
.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.use-case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.use-case h3 {
  margin-bottom: 8px;
}

.use-case p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Language grid */
.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.lang-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FAQ */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--surface);
}

details summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: "+";
  margin-right: 10px;
  color: var(--accent);
  font-weight: 700;
}

details[open] summary::before {
  content: "−";
}

details p {
  padding: 0 16px 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row button {
    width: 100%;
  }

  .track-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
