/* ================================================
   QA/QC AI ASSISTANT — Design System
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-base:        #090909;
  --bg-primary:     #0e0e0e;
  --bg-secondary:   #141414;
  --bg-card:        #1a1a1a;
  --bg-card-hover:  #202020;
  --bg-input:       #111111;

  --gold:           #c9a84c;
  --gold-light:     #e6c06a;
  --gold-bright:    #f5d080;
  --gold-dim:       #8b6914;
  --gold-glow:      rgba(201,168,76,0.15);
  --gold-border:    rgba(201,168,76,0.25);
  --gold-border-hv: rgba(201,168,76,0.55);

  --text-primary:   #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted:     #606060;
  --text-gold:      #c9a84c;

  --sidebar-w:      72px;
  --stages-w:       390px;
  --header-h:       70px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-xl:      22px;

  --shadow-gold:    0 0 20px rgba(201,168,76,0.12);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.4);
  --transition:     all 0.28s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Outfit', 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── App Layout ── */
.app-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-base);
}

/* ── Icon Button ── */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
}
.btn-icon:hover {
  background: var(--gold-glow);
  border-color: var(--gold-border-hv);
  color: var(--gold-light);
  transform: translateY(-1px);
}
.btn-icon.active { background: var(--gold-glow); color: var(--gold); border-color: var(--gold); }

/* ── Gold Button ── */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #0e0e0e;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  border: none;
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.35);
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--gold-border);
  margin: 12px 0;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--gold);
  color: #0e0e0e;
  font-size: 11px;
  font-weight: 700;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(201,168,76,0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes typing-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-gold);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: #2a7a4a; }
.toast.error   { border-color: #7a2a2a; }

/* ── Modal Overlay ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 480px;
  max-width: 95vw;
  box-shadow: var(--shadow-gold);
  animation: fadeInUp 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(180,60,60,0.2); color: #e88; }

/* ── Form Elements ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input option { background: var(--bg-card); }
