/* ═══════════════════════════════════════════════
   SlideForge — style.css
   ═══════════════════════════════════════════════ */

/* ── CSS VARIABLES (design tokens) ── */
:root {
  --bg:          #0a0a0f;
  --surface:     #111118;
  --surface2:    #1a1a24;
  --surface3:    #22222e;
  --border:      rgba(255, 255, 255, 0.07);
  --border2:     rgba(255, 255, 255, 0.12);
  --accent:      #6c63ff;
  --accent2:     #a78bfa;
  --accent-glow: rgba(108, 99, 255, 0.15);
  --text:        #f0eeff;
  --text2:       #9d99b8;
  --text3:       #5c5878;
  --green:       #22d3a5;
  --green-dim:   rgba(34, 211, 165, 0.12);
  --red:         #f87171;
  --amber:       #fbbf24;
  --blue:        #38bdf8;
  --radius:      10px;
  --radius-lg:   16px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── APP SHELL ── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── NAVIGATION ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent2);
  background: var(--surface3);
  flex-shrink: 0;
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ── MAIN ── */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── SCREENS ── */
.screen { display: none; }
.screen.active { display: block; }

/* ════════════════════════════════
   AUTH
════════════════════════════════ */
.auth-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  gap: 2rem;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.auth-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 1rem;
}

.auth-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 2rem;
}

/* Google button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: box-shadow 0.15s, background 0.15s;
}

.google-btn:hover {
  background: #f8f8f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.google-btn svg { flex-shrink: 0; }

.google-note {
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
  text-align: center;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.divider span {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--accent2);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; text-align: left; }
.tab-content.active { display: block; }

/* Form elements */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}

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

/* ════════════════════════════════
   BUTTONS
════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { background: #7c74ff; transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger  { background: rgba(248,113,113,0.15); color: var(--red);   border: 1px solid rgba(248,113,113,0.3); }
.btn-danger:hover  { background: rgba(248,113,113,0.25); }

.btn-green   { background: var(--green-dim);        color: var(--green); border: 1px solid rgba(34,211,165,0.3); }
.btn-green:hover   { background: rgba(34,211,165,0.2); }

.btn-blue    { background: rgba(56,189,248,0.1);    color: var(--blue);  border: 1px solid rgba(56,189,248,0.25); }
.btn-blue:hover    { background: rgba(56,189,248,0.18); }

.btn-sm { padding: 0.45rem 0.9rem; font-size: 13px; }

/* Big run button */
.btn-run {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 1rem 3rem;
  border-radius: 50px;
  transition: all 0.2s;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 30px rgba(108, 99, 255, 0.35);
}

.btn-run:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(108, 99, 255, 0.5);
}

.btn-run:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ════════════════════════════════
   DASHBOARD
════════════════════════════════ */
.page-header { margin-bottom: 2rem; }

.page-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-header p { color: var(--text2); font-size: 14px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card p { font-size: 13px; color: var(--text2); }

/* ── Drive status ── */
.drive-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  margin-bottom: 1rem;
}

.drive-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}

.drive-status.connected .dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.drive-status .ds-label { font-size: 13px; color: var(--text2); flex: 1; }
.drive-status .ds-email { font-size: 12px; color: var(--text3); font-family: 'DM Mono', monospace; }

/* Output folder notice */
.output-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  background: var(--green-dim);
  border: 1px solid rgba(34, 211, 165, 0.2);
  border-radius: var(--radius);
  font-size: 13px;
}

.output-notice .on-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.output-notice .on-text { color: var(--text2); }
.output-notice .on-text strong { color: var(--green); font-weight: 500; }

/* ── Settings row ── */
.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.setting-row label {
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  min-width: 130px;
}

select {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 0.45rem 0.75rem;
  outline: none;
  cursor: pointer;
  transition: border 0.2s;
}

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

/* ── Folder picker ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.bc-item { cursor: pointer; color: var(--accent2); }
.bc-item:hover { text-decoration: underline; }
.bc-sep { color: var(--text3); }

.folder-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
}

.folder-item:last-child { border-bottom: none; }
.folder-item:hover { background: var(--surface2); }
.fi-icon { font-size: 15px; flex-shrink: 0; }
.fi-name { flex: 1; }
.fi-arrow { color: var(--text3); font-size: 13px; }

.selected-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 1rem;
  background: var(--accent-glow);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 13px;
}

.sf-label { color: var(--text2); }
.sf-path { color: var(--accent2); font-weight: 500; flex: 1; }

/* ── Music picker ── */
.music-list { display: flex; flex-direction: column; gap: 8px; }

.music-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
  cursor: pointer;
}

.music-item:hover { border-color: var(--border2); }
.music-item.selected { border-color: var(--accent); background: var(--accent-glow); }

.music-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  font-size: 11px;
}

.music-item.selected .music-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.music-info { flex: 1; }
.mi-title  { font-size: 14px; font-weight: 500; }
.mi-artist { font-size: 12px; color: var(--text2); }
.mi-dur    { font-size: 11px; color: var(--text3); font-family: 'DM Mono', monospace; }

.music-play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.music-play:hover { border-color: var(--accent); color: var(--accent); }

/* ── Run section ── */
.run-section {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.run-hint { font-size: 12px; color: var(--text3); text-align: center; }

.start-from-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: var(--text2);
}

.start-from-row input {
  width: 64px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text1);
  font-size: 13px;
  text-align: center;
}

.btn-cancel {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-cancel:hover { border-color: #f87171; color: #f87171; }
.btn-cancel:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Progress ── */
.progress-section { margin-top: 2rem; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
}

.progress-bar {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  border-radius: 2px;
  transition: width 0.4s;
}

.job-log {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 220px;
  overflow-y: auto;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.9;
}

.log-success { color: var(--green); }
.log-info    { color: var(--accent2); }
.log-warn    { color: var(--amber); }
.log-upload  { color: var(--blue); }

/* ── Results ── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}

.result-card:hover { border-color: var(--border2); }

.result-thumb {
  height: 120px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.result-thumb video { width: 100%; height: 100%; object-fit: cover; }

.result-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text2);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
}

.result-saved {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(34, 211, 165, 0.9);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.result-body { padding: 0.75rem; }
.result-body h4 { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.result-body p  { font-size: 11px; color: var(--text3); margin-bottom: 0.5rem; }
.result-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ════════════════════════════════
   REUSABLE COMPONENTS
════════════════════════════════ */

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-green  { background: var(--green-dim);    color: var(--green);  }
.badge-accent { background: var(--accent-glow);  color: var(--accent2); }

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

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

/* Empty state */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text3); font-size: 14px; }
.empty-icon { font-size: 32px; margin-bottom: 0.75rem; }

/* ════════════════════════════════
   UTILITY CLASSES
════════════════════════════════ */
.flex            { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: 0.5rem; }
.mb-2  { margin-bottom: 1rem; }
.text-sm   { font-size: 13px; }
.text-muted { color: var(--text2); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
