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

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #e2e6ea;
  --primary: #635bff;
  --primary-hover: #5a4fd6;
  --primary-light: #f0eeff;
  --danger: #e74c3c;
  --danger-bg: #fef2f2;
  --success: #27ae60;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Container ===== */
.container {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #635bff, #e1306c, #f77737);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ===== Tool Card ===== */
.tool-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

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

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

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== Drop Zone ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.drop-icon { margin-bottom: 12px; }

.drop-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: inherit;
}

.drop-text .link {
  color: var(--primary);
  text-decoration: underline;
}

.drop-hint {
  font-size: 0.8rem;
  margin-top: 8px;
  color: var(--text-muted);
}

/* ===== File Info ===== */
.file-info {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

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

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== URL Input ===== */
.url-group {
  display: flex;
  gap: 8px;
}

.url-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s ease;
  min-width: 0;
}

.url-input:focus {
  border-color: var(--primary);
}

.panel-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.url-note {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
}

.url-note a {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== Buttons ===== */
.btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.url-group .btn-primary { width: auto; padding: 12px 20px; }

.btn-ghost {
  padding: 7px 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost.copied {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

/* ===== Processing ===== */
.processing {
  text-align: center;
  padding: 32px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.7s linear infinite;
}

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

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

.progress-bar {
  width: 200px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ===== Error ===== */
.error-box {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid #f5c6cb;
  margin-bottom: 20px;
}

/* ===== Transcript ===== */
.transcript-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.transcript-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 8px;
}

.transcript-output {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.transcript-output p {
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.transcript-output .timestamp {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-right: 8px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* ===== Content Pages ===== */
.logo-link {
  text-decoration: none;
}

.content-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  margin-bottom: 20px;
}

.content-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.content-card .updated {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.content-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
}

.content-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.content-card ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 10px;
}

.content-card ul li {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 4px;
}

.content-card a {
  color: var(--primary);
  text-decoration: underline;
}

@media (min-width: 480px) {
  .content-card { padding: 32px 28px; }
  .content-card h2 { font-size: 1.5rem; }
}

/* ===== Utilities ===== */
.hidden { display: none !important; }

/* ===== Responsive ===== */
@media (min-width: 480px) {
  .container { padding: 32px 20px 48px; }
  .logo { font-size: 2.2rem; }
  .tagline { font-size: 1rem; }
  .tool-card { padding: 24px; }
  .drop-zone { padding: 48px 24px; }
}

@media (min-width: 768px) {
  .container { padding: 48px 24px 56px; }
  .transcript-output { max-height: 500px; }
}
