/* =============================================================================
   VidPipe Studio — Team Interface Theme (Outfit + Purple accent)
   ============================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

.team-app {
  --bg: #F7F7F8;
  --surface: #FFFFFF;
  --border: #E8E8EC;
  --border2: #D1D1D6;
  --text: #1A1A1E;
  --text2: #6E6E78;
  --text3: #A0A0AB;
  --accent: #5B5EF4;
  --accent2: #4B4ED4;
  --accent-soft: rgba(91,94,244,0.07);
  --accent-mid: rgba(91,94,244,0.14);
  --green: #22C55E;
  --green-soft: rgba(34,197,94,0.08);
  --red: #EF4444;
  --red-soft: rgba(239,68,68,0.08);
  --warn: #F59E0B;
  --warn-soft: rgba(245,158,11,0.08);
  --r: 10px;
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.team-app[data-theme="dark"] {
  --bg: #111114;
  --surface: #1A1A1F;
  --border: #2A2A30;
  --border2: #3A3A42;
  --text: #E8E8EC;
  --text2: #9A9AA6;
  --text3: #5A5A66;
  --accent-soft: rgba(91,94,244,0.12);
  --accent-mid: rgba(91,94,244,0.22);
  --green-soft: rgba(34,197,94,0.12);
  --red-soft: rgba(239,68,68,0.12);
  --warn-soft: rgba(245,158,11,0.12);
}

/* Header */
.t-header {
  padding: 14px 40px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.t-brand { display: flex; align-items: center; gap: 8px; }
.t-brand-dot {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.t-brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; }
.t-header-right { display: flex; align-items: center; gap: 16px; }
.t-back {
  font-size: 12px; color: var(--text3); cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; font-family: inherit;
  transition: color .15s;
}
.t-back:hover { color: var(--text2); }
.t-user {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px; border: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}
.t-user-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.t-chrono {
  padding: 4px 12px; border-radius: 20px;
  background: var(--warn-soft); font-size: 12px;
  font-weight: 600; color: var(--warn);
}
.t-theme-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-size: 12px; transition: all .15s;
}
.t-theme-btn:hover { border-color: var(--border2); color: var(--text2); }

/* Progress */
.t-progress { padding: 0 40px; margin-top: 20px; }
.t-progress-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.t-progress-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.t-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s ease; }
.t-progress-label { font-size: 11px; color: var(--text3); white-space: nowrap; font-weight: 500; min-width: 60px; text-align: right; }

/* Main */
.t-main { max-width: 1100px; margin: 0 auto; padding: 28px 40px 80px; }
.t-page-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.t-page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.t-page-id { font-size: 11px; color: var(--text3); font-family: monospace; }

/* Layout */
.t-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }

/* Step */
.t-step { margin-bottom: 20px; }
.t-step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.t-sn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
}
.t-sn.done { background: var(--green-soft); color: var(--green); }
.t-st { font-size: 12px; font-weight: 600; letter-spacing: -0.1px; }
.t-step-opt { font-size: 10px; color: var(--text3); margin-left: auto; }

.t-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  transition: border-color .15s;
}
.t-card:hover { border-color: var(--border2); }

/* Products */
.t-prod-list { display: flex; gap: 10px; flex-wrap: wrap; }
.t-prod {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 10px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer; transition: all .15s;
  background: var(--surface);
  flex: 1; min-width: 200px;
}
.t-prod:hover { border-color: var(--border2); }
.t-prod.sel { border-color: var(--accent); background: var(--accent-soft); }
.t-prod-icon {
  width: 44px; height: 44px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0;
  background: var(--bg);
}
.t-prod-icon img { width: 100%; height: 100%; object-fit: cover; }
.t-prod-info { flex: 1; }
.t-prod-info .pn { font-size: 13px; font-weight: 600; }
.t-prod-info .pm { font-size: 10px; color: var(--text3); }
.t-prod .pc {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0;
}
.t-prod.sel .pc { background: var(--accent); border-color: var(--accent); }

/* Script */
.t-script {
  width: 100%; min-height: 180px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-family: 'Outfit', sans-serif;
  font-size: 13px; color: var(--text);
  line-height: 1.7; resize: vertical;
  transition: border-color .15s;
  background: var(--surface);
}
.t-script::placeholder { color: var(--text3); }
.t-script:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.t-script-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.t-char-count { font-size: 10px; color: var(--text3); font-family: monospace; }

/* Avatar drop */
.t-av-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--r);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer; transition: all .2s;
}
.t-av-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.t-av-drop-ic {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 8px; font-size: 16px;
}
.t-av-drop-t { font-size: 13px; font-weight: 500; }
.t-av-drop-s { font-size: 10px; color: var(--text3); margin-top: 2px; }

/* Avatar preview */
.t-av-prev { display: flex; gap: 14px; align-items: center; }
.t-av-prev-img {
  width: 80px; height: 100px; border-radius: 8px;
  object-fit: cover; border: 2px solid var(--green); flex-shrink: 0;
}
.t-av-prev-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--green); margin-bottom: 4px;
}
.t-av-prev-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.t-av-prev-hint { font-size: 11px; color: var(--text3); line-height: 1.4; }
.t-av-prev-btn {
  margin-top: 6px; font-size: 11px; color: var(--accent);
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-weight: 500; padding: 0;
}
.t-av-prev-btn:hover { text-decoration: underline; }

/* Library */
.t-lib-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 8px; }
.t-lib-row { display: flex; gap: 6px; }
.t-lib-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  cursor: pointer; border: 2px solid transparent;
  transition: all .15s; opacity: .55; object-fit: cover;
}
.t-lib-thumb:hover { opacity: 1; border-color: var(--border2); }

/* Summary */
.t-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--surface);
}
.t-summary-ic {
  width: 38px; height: 38px; border-radius: 6px;
  overflow: hidden; flex-shrink: 0;
}
.t-summary-ic img { width: 100%; height: 100%; object-fit: cover; }
.t-summary-n { font-size: 12px; font-weight: 600; }
.t-summary-m { font-size: 10px; color: var(--text3); }

/* Generate button */
.t-btn-go {
  width: 100%; padding: 13px;
  background: var(--accent); border: none;
  border-radius: var(--r);
  color: #fff; font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.t-btn-go:hover { background: var(--accent2); box-shadow: 0 6px 20px rgba(91,94,244,0.2); }
.t-btn-go:active { transform: scale(0.98); }
.t-btn-go:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; transform: none; }
.t-gen-sub { text-align: center; margin-top: 6px; font-size: 11px; color: var(--text3); }

/* Scene cards (images/done phase) */
.t-scene-card {
  border-radius: 12px; overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color .15s;
}
.t-scene-card.approved { border-color: var(--green); }
.t-scene-img {
  width: 100%; aspect-ratio: 9/16;
  object-fit: cover; display: block;
}
.t-scene-label {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 10px; border-radius: 6px;
  font-size: 10px; font-weight: 700; color: #fff;
}
.t-scene-check {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); display: flex;
  align-items: center; justify-content: center;
}
.t-scene-info { padding: 12px; }
.t-scene-title { font-size: 13px; font-weight: 600; }
.t-scene-dur { font-size: 10px; color: var(--text3); }

/* Buttons */
.t-btn {
  padding: 7px 14px; border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
  border: none;
}
.t-btn-approve { background: var(--green); color: #fff; }
.t-btn-approve:hover { opacity: 0.9; }
.t-btn-regen { background: var(--surface); border: 1px solid var(--border); color: var(--text2); }
.t-btn-regen:hover { border-color: var(--border2); }
.t-btn-ghost { background: none; border: none; color: var(--text3); font-size: 11px; }
.t-btn-ghost:hover { color: var(--accent); }
.t-btn-download { background: var(--accent); color: #fff; text-decoration: none; }
.t-btn-download:hover { background: var(--accent2); }

/* Stats */
.t-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.t-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px; text-align: center;
}
.t-stat-val { font-size: 24px; font-weight: 700; }
.t-stat-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* Campaign list */
.t-camp-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer; transition: all .15s;
}
.t-camp-card:hover { border-color: var(--border2); }
.t-camp-thumb {
  width: 44px; height: 58px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
}
.t-camp-info { flex: 1; }
.t-camp-name { font-size: 13px; font-weight: 600; }
.t-camp-meta { font-size: 10px; color: var(--text3); margin-top: 2px; }
.t-camp-badge {
  padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600;
}
.t-camp-badge.done { background: var(--green-soft); color: var(--green); }
.t-camp-badge.wip { background: var(--warn-soft); color: var(--warn); }

/* Center content */
.t-center { text-align: center; max-width: 500px; margin: 0 auto; }

/* Spinner */
.t-spin {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.t-spin-lg { width: 48px; height: 48px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Feedback input */
.t-input {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-family: 'Outfit', sans-serif;
  font-size: 12px; color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
}
.t-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.t-input::placeholder { color: var(--text3); }

/* Animation */
@keyframes tUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.t-anim { animation: tUp .4s ease forwards; opacity: 0; }
.t-d1 { animation-delay: .04s; }
.t-d2 { animation-delay: .08s; }
.t-d3 { animation-delay: .12s; }
.t-d4 { animation-delay: .16s; }

/* Stars */
.t-star { cursor: pointer; font-size: 18px; background: none; border: none; transition: color .15s; padding: 0 1px; }
.t-star.on { color: #F59E0B; }
.t-star.off { color: var(--border2); }

@media (max-width: 860px) {
  .t-layout { grid-template-columns: 1fr; }
  .t-main { padding: 24px 20px 60px; }
  .t-header { padding: 14px 20px; }
  .t-progress { padding: 0 20px; }
  .t-stats { grid-template-columns: repeat(2, 1fr); }
}
