/* ClipBridge Creator Dashboard Styles */

:root {
  --bg: #F5F0EB;
  --fg: #1A1A1A;
  --fg-muted: #6B5B4F;
  --accent: #C4622D;
  --accent-light: #E07B45;
  --accent-dark: #8B3A1A;
  --surface: #EDE6DC;
  --surface-dark: #2D1A12;
  --border: rgba(196,98,45,0.15);
  --success: #4CAF50;
  --danger: #e53935;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ─── App Shell ─────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────── */
.sidebar {
  width: 220px;
  background: var(--surface-dark);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(196,98,45,0.2);
  margin-bottom: 8px;
}
.brand-name {
  font-family: 'Season Serif', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: block;
}
.brand-sub {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-item:hover, .nav-item.active {
  background: rgba(196,98,45,0.15);
  color: #fff;
}
.nav-icon { font-size: 16px; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(196,98,45,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-status { font-size: 11px; color: var(--success); }

/* ─── Main Content ─────────────────────────────── */
.main-content {
  flex: 1;
  overflow: auto;
  padding: 32px 40px;
  max-width: 900px;
}

/* ─── Page Header ─────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header-left {}
.breadcrumb {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
}
.breadcrumb:hover { text-decoration: underline; }
.page-title {
  font-family: 'Season Serif', Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
}

/* ─── Stats ────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid var(--border);
}
.stat-val {
  display: block;
  font-family: 'Season Serif', Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 12px; color: var(--fg-muted); font-weight: 500; }

/* ─── Panels ────────────────────────────────── */
.panel {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.panel-title {
  font-family: 'Season Serif', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--fg);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 16px;
}
.section-header h3 {
  font-family: 'Season Serif', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-dark); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--fg); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Upload Zone ────────────────────────────── */
.upload-zone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  margin-bottom: 32px;
  transition: all 0.2s;
}
.upload-zone.drag-over { border-color: var(--accent); background: rgba(196,98,45,0.05); }
.upload-icon {
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 12px;
}
.upload-zone h3 { font-family: 'Season Serif', Georgia, serif; font-size: 22px; margin-bottom: 6px; }
.upload-zone p { font-size: 14px; color: var(--fg-muted); margin-bottom: 20px; }
.upload-progress { margin-top: 16px; }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}
.progress-text { font-size: 12px; color: var(--fg-muted); }

/* ─── Video Grid ─────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.15s;
}
.video-card:hover { box-shadow: 0 4px 20px rgba(196,98,45,0.12); }
.video-thumb {
  height: 140px;
  background: var(--surface-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 32px;
  position: relative;
}
.video-thumb .duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.video-info { padding: 14px; }
.video-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-meta { font-size: 12px; color: var(--fg-muted); }
.video-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}
.video-status.uploaded { background: rgba(76,175,80,0.15); color: #388E3C; }
.video-status.processing { background: rgba(255,152,0,0.15); color: #F57C00; }
.video-status.segmented { background: rgba(33,150,243,0.15); color: #1976D2; }
.video-status.failed { background: rgba(229,57,53,0.15); color: #C62828; }
.video-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

/* ─── Segment List ────────────────────────────── */
.segment-list { display: flex; flex-direction: column; gap: 12px; }
.segment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.15s;
}
.segment-card:hover { border-color: rgba(196,98,45,0.3); }
.segment-thumb {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  background: var(--surface-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 20px;
  flex-shrink: 0;
}
.segment-body { flex: 1; min-width: 0; }
.segment-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.segment-time {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: monospace;
}
.segment-score { font-size: 11px; color: var(--accent); margin-top: 2px; }
.segment-status-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.segment-status-badge.pending { background: rgba(255,152,0,0.15); color: #F57C00; }
.segment-status-badge.approved { background: rgba(76,175,80,0.15); color: #388E3C; }
.segment-status-badge.rejected { background: rgba(229,57,53,0.15); color: #C62828; }
.segment-status-badge.merged { background: rgba(0,0,0,0.1); color: var(--fg-muted); }
.segment-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}
.segment-ad-slot {
  margin-top: 8px;
  padding: 8px;
  background: rgba(196,98,45,0.08);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}

/* ─── Video Selector ─────────────────────────── */
.video-selector {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.video-chip {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.video-chip:hover, .video-chip.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ─── Render / Output ─────────────────────────── */
.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.output-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.output-thumb {
  height: 120px;
  background: var(--surface-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 24px;
}
.output-info { padding: 14px; }
.output-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.output-meta { font-size: 12px; color: var(--fg-muted); }
.output-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

/* ─── Steps Guide ─────────────────────────────── */
.steps-guide { display: flex; flex-direction: column; gap: 16px; }
.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.step-n {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.step-body { flex: 1; }
.step-body strong { font-size: 14px; display: block; margin-bottom: 3px; }
.step-body p { font-size: 13px; color: var(--fg-muted); }

/* ─── Empty State ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--fg-muted);
  font-size: 14px;
}
.empty-state a { color: var(--accent); }

/* ─── Toast ────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface-dark);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  animation: toastIn 0.2s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Login ────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-box {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(45,26,18,0.1);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.login-brand .brand-name {
  font-family: 'Season Serif', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
}
.brand-tag {
  font-size: 11px;
  color: var(--accent);
  background: rgba(196,98,45,0.1);
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.login-box h2 {
  font-family: 'Season Serif', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}
.login-sub { font-size: 14px; color: var(--fg-muted); margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--fg); }
.form-group input, .form-group select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error {
  padding: 10px 14px;
  background: rgba(229,57,53,0.1);
  border: 1px solid rgba(229,57,53,0.2);
  border-radius: 8px;
  color: #C62828;
  font-size: 13px;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    position: static;
    padding: 0 16px;
    overflow-x: auto;
  }
  .sidebar-brand { padding: 12px 0; border-bottom: none; border-right: 1px solid rgba(196,98,45,0.2); margin-right: 12px; padding-right: 12px; }
  .sidebar-nav { display: flex; gap: 0; padding: 0; }
  .nav-item { padding: 16px 12px; white-space: nowrap; }
  .sidebar-user { border-top: none; border-left: 1px solid rgba(196,98,45,0.2); padding: 12px 0 12px 12px; margin-left: 12px; }
  .main-content { padding: 20px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}