/* ============================================================
   Virtual Promo — Main Stylesheet
   ============================================================ */

:root {
  --bg:       #080a10;
  --surface:  #0d1018;
  --surface2: #141820;
  --border:   rgba(255,255,255,0.06);
  --accent:   #6366f1;
  --accent2:  #8b5cf6;
  --text:     #e8eaf0;
  --muted:    #5a6070;
  --sidebar:  260px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Syne', 'Noto Sans Thai', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  margin: 0;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar          { width: 4px; }
::-webkit-scrollbar-thumb    { background: #1e2530; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Animations ────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes fadeIn  { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
@keyframes dropIn  { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.fade-in { animation: fadeIn 0.3s ease-out; }

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  min-width: var(--sidebar);
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
  position: relative;
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  margin-bottom: 36px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text              { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.logo-text span         { color: var(--accent); }

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0 12px;
  margin-bottom: 8px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover              { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active             { background: rgba(99,102,241,0.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }

.nav-item .step-badge {
  width: 20px;
  height: 20px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  color: var(--muted);
}
.nav-item.active .step-badge { background: rgba(99,102,241,0.25); color: #a5b4fc; }

/* ── Main layout ────────────────────────────────────── */
.main { flex: 1; height: 100%; overflow: hidden; display: flex; flex-direction: column; }

/* ── Top bar ────────────────────────────────────────── */
.topbar {
  height: 62px;
  min-height: 62px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--surface);
}

.topbar-breadcrumb  { display: flex; align-items: center; gap: 8px; }
.topbar-step        { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.topbar-title       { font-size: 14px; font-weight: 700; color: var(--text); }
.topbar-sep         { color: var(--muted); font-size: 12px; }

/* ── Content scroll area ────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 36px 40px; }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

/* ── Drop zone ──────────────────────────────────────── */
.dropzone {
  border: 2px dashed rgba(99,102,241,0.25);
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: rgba(99,102,241,0.02);
  position: relative;
}
.dropzone:hover,
.dropzone.drag-over          { border-color: rgba(99,102,241,0.6); background: rgba(99,102,241,0.06); }
.dropzone.drag-over          { transform: scale(1.01); }

.dropzone-icon {
  width: 72px;
  height: 72px;
  background: rgba(99,102,241,0.1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  transition: transform 0.2s;
}
.dropzone:hover .dropzone-icon { transform: translateY(-3px); }

/* ── Voice dropdown ─────────────────────────────────── */
.voice-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #111520;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  z-index: 200;
  max-height: 380px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.voice-dropdown.show         { display: block; animation: dropIn 0.15s ease-out; }

.vd-cat-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 14px 16px 6px;
  position: sticky;
  top: 0;
  background: #111520;
}

.vd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
  margin: 0 6px;
}
.vd-item:hover    { background: rgba(255,255,255,0.05); }
.vd-item.selected { background: rgba(99,102,241,0.12); }

.vd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Emotion chips ──────────────────────────────────── */
.emotion-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.emotion-chip {
  padding: 9px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  line-height: 1.3;
  color: var(--text);
  font-family: inherit;
}
.emotion-chip:hover { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); transform: translateY(-1px); }
.emotion-chip .emoji { font-size: 16px; }

/* ── Buttons ────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 25px rgba(99,102,241,0.3); }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }

/* ── Lang tag pill ──────────────────────────────────── */
.lang-tag {
  padding: 4px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

/* ── Textarea ───────────────────────────────────────── */
textarea {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  resize: vertical !important;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.8;
  min-height: 200px;
  width: 100%;
}
textarea::placeholder { color: var(--muted); font-size: 15px; }

/* ── Custom audio player ────────────────────────────── */
.audio-player-wrap {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 16px;
  padding: 16px 18px;
}

.custom-player { display: flex; align-items: center; gap: 14px; }

.player-play-btn {
  width: 40px; height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.player-play-btn:hover       { transform: scale(1.08); }
.player-play-btn svg         { color: white; }

.player-track                { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.player-progress-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.player-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 10px;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}

.player-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: rgba(165,180,252,0.7);
}

.player-vol-wrap { display: flex; align-items: center; gap: 8px; }

.player-vol-icon  { color: rgba(165,180,252,0.8); cursor: pointer; }

.player-vol-slider {
  -webkit-appearance: none;
  width: 70px;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  outline: none;
}
.player-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(99,102,241,0.5);
}

/* ── Loading overlay ────────────────────────────────── */
#overlay-loader {
  position: fixed;
  inset: 0;
  background: rgba(8,10,16,0.92);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
#overlay-loader.show { display: flex; }

.loader-ring {
  width: 52px; height: 52px;
  border: 2px solid rgba(99,102,241,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Voice trigger button ───────────────────────────── */
.voice-trigger {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s;
}
.voice-trigger:hover { border-color: rgba(99,102,241,0.4); }

/* ── Section titles ─────────────────────────────────── */
.section-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.section-sub   { font-size: 15px; color: var(--muted); line-height: 1.5; }

.card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Status dot ─────────────────────────────────────── */
.status-dot { width: 7px; height: 7px; background: #22c55e; border-radius: 50%; display: inline-block; }
.pulse      { animation: pulse 2s infinite; }

/* ── File info bar ──────────────────────────────────── */
.file-info-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Tab content visibility ─────────────────────────── */
.tab-content         { display: none; }
.tab-content.active  { display: block; }

/* ── Model selector (sidebar) ───────────────────────── */
.model-selector {
  margin-top: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.model-selector-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.model-option:last-child   { margin-bottom: 0; }
.model-option:hover        { background: rgba(255,255,255,0.04); }
.model-option.selected     { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.25); }

.model-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  flex-shrink: 0;
  transition: all 0.15s;
}
.model-option.selected .model-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(99,102,241,0.5);
}

.model-name { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.model-desc { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* ── PIN Lock Screen ────────────────────────────────── */
#pin-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #080a10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}
.pin-dot.filled { background: #6366f1; border-color: #6366f1; }
.pin-dot.error  { background: #f87171; border-color: #f87171; }

.pin-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e8eaf0;
  font-size: 22px;
  font-weight: 600;
  font-family: 'Syne', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.pin-btn:hover  { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); }
.pin-btn:active { transform: scale(0.9); background: rgba(99,102,241,0.35); }
.pin-btn-sub    { background: rgba(255,255,255,0.03); font-size: 13px; color: #5a6070; }

/* ── Select inputs (used in voice/SRT pages) ────────── */
select {
  background: #141820;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
