/* ============================
   ConvertToPodcast Styles
   ============================ */

:root {
  --bg: #0a0a0f;
  --bg-card: #141420;
  --bg-card-hover: #1a1a2e;
  --border: #2a2a3e;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-dim: #4f46e5;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

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

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* Navigation */
.nav {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(12px);
  z-index: 100;
}

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

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

.nav-links { display: flex; gap: 24px; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

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

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #6366f1, #a855f7, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Tool Card */
.tool-section { padding: 0 0 60px; }

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

/* Input Tabs */
.input-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

/* Input Panels */
.input-panel { display: none; }
.input-panel.active { display: block; }

.input-field {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

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

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

.textarea { resize: vertical; min-height: 120px; font-family: inherit; }

/* Clear button positioning in URL panel */
#panel-url { position: relative; }
#clear-url {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  display: none;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover { border-color: var(--accent); background: rgba(99,102,241,0.05); }
.upload-zone.dragover { border-color: var(--green); background: rgba(34,197,94,0.05); }

.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-link { color: var(--accent); text-decoration: underline; cursor: pointer; }
.upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

/* Settings */
.settings { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }

.setting-row { display: flex; gap: 16px; }
.setting-group { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.setting-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.select-field {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-field:focus { border-color: var(--accent); }

/* Generate Button */
.generate-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.generate-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99,102,241,0.3); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-loading { display: inline-flex; align-items: center; gap: 8px; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Result Section */
.result-section {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(34,197,94,0.05));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.result-header h3 { font-size: 1.1rem; }

.credit-badge {
  padding: 4px 12px;
  background: rgba(99,102,241,0.15);
  color: var(--accent-hover);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.audio-player { margin-bottom: 16px; }

.audio-player audio {
  width: 100%;
  border-radius: var(--radius-sm);
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
}

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

.result-info {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Error */
.error-section {
  margin-top: 16px;
  padding: 16px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
}

.error-text { color: var(--red); font-size: 0.9rem; }

/* Credits Info */
.credits-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.8;
}

.credit-count { margin-top: 4px; font-size: 0.85rem; }
.credit-count strong { color: var(--text); }

/* How it Works */
.how-it-works {
  padding: 60px 0;
  background: var(--bg-card);
}

.how-it-works h2, .use-cases h2, .faq h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 48px;
}

.steps {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.step {
  flex: 1;
  text-align: center;
  padding: 32px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-num {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.step h3 { margin-bottom: 8px; font-size: 1.1rem; }
.step p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* Use Cases */
.use-cases { padding: 60px 0; }

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

.case-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.case-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.case-icon { font-size: 2rem; margin-bottom: 12px; }
.case-card h3 { font-size: 1rem; margin-bottom: 8px; }
.case-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* FAQ */
.faq { padding: 60px 0; background: var(--bg-card); }

.faq-list { max-width: 700px; margin: 0 auto; }

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

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

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

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

.faq-item p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Footer */
.footer {
  padding: 48px 20px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-col h4 { margin-bottom: 16px; font-size: 0.9rem; color: var(--text); }
.footer-col p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 8px;
  transition: color 0.2s;
}

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

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    gap: 12px;
  }

  .hero { padding: 48px 0 32px; }
  .tool-card { padding: 20px; }
  .setting-row { flex-direction: column; gap: 12px; }

  .steps { flex-direction: column; }
  .steps, .cases-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 600px) {
  .result-actions { flex-direction: column; }
  .action-btn { width: 100%; text-align: center; }
}
