/* ============================================================
   components.css — Reusable UI components
   Buttons, cards, badges, inputs, empty states, toasts
   ============================================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2563EB);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #DC2626; }

/* Kingschat login button */
.btn-kingschat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--kc-blue), var(--kc-blue-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--kc-glow);
  letter-spacing: 0.01em;
}
.btn-kingschat:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(33,150,243,0.45); }
.btn-kingschat:active { transform: translateY(0); }

.kc-logo-wrap {
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Upload button (topbar) */
.btn-upload {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent), #2563EB);
  border: none;
  border-radius: 20px;
  color: white;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-upload:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,0.35); }

/* Tool button (viewer toolbar) */
.tool-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}
.tool-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.tool-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

/* ── Stat cards ── */
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue  { background: rgba(59,130,246,0.1); }
.stat-icon.teal  { background: rgba(6,182,212,0.1); }
.stat-icon.green { background: rgba(16,185,129,0.1); }
.stat-icon.amber { background: rgba(245,158,11,0.1); }

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.stat-change { font-size: 11px; font-weight: 600; margin-top: 4px; }
.stat-change.up      { color: var(--success); }
.stat-change.down    { color: var(--danger); }
.stat-change.neutral { color: var(--text-muted); }

/* ── Project cards ── */
.project-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(59,130,246,0.2);
}

.project-thumb {
  height: 140px;
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-thumb-pdf {
  width: 64px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 8px 6px;
}
.project-thumb-label {
  position: absolute;
  top: 10px; right: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  color: var(--text-secondary);
}
.project-thumb-color {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
}

/* Card color accents */
.accent-blue   { background: linear-gradient(90deg, var(--accent), #60A5FA); }
.accent-teal   { background: linear-gradient(90deg, var(--accent-2), #34D399); }
.accent-purple { background: linear-gradient(90deg, #8B5CF6, #EC4899); }
.accent-orange { background: linear-gradient(90deg, #F59E0B, #EF4444); }
.accent-green  { background: linear-gradient(90deg, #10B981, #06B6D4); }

.project-info { padding: 14px; }
.project-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.project-version {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: rgba(59,130,246,0.08); padding: 2px 7px; border-radius: 4px;
}
.project-date { font-size: 11px; color: var(--text-muted); }
.project-footer { display: flex; align-items: center; justify-content: space-between; }
.project-comments { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-secondary); font-weight: 500; }

/* Status badges */
.status-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.status-review   { background: rgba(245,158,11,0.1); color: var(--warning); }
.status-approved { background: rgba(16,185,129,0.1); color: var(--success); }
.status-draft    { background: var(--surface-2); color: var(--text-secondary); }

/* ── Quick action cards ── */
.qa-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.qa-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.qa-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.qa-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.qa-sub   { font-size: 11px; color: var(--text-secondary); }

/* ── Folder cards ── */
.folder-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.folder-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.folder-icon { font-size: 28px; margin-bottom: 10px; }
.folder-name { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.folder-meta { font-size: 11px; color: var(--text-muted); }

/* ── Form inputs ── */
.form-input, .modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: white;
  outline: none;
  transition: var(--transition);
}
.form-input:focus, .modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder, .modal-input::placeholder { color: var(--text-muted); }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

/* ── Empty states ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-icon  { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--sidebar-bg);
  color: white;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  pointer-events: all;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-icon { font-size: 16px; flex-shrink: 0; }

/* ── Loading skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: skeleton-load 1.4s ease infinite;
  border-radius: 4px;
}
@keyframes skeleton-load { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Section headers ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-action {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.section-action:hover { color: #2563EB; }

/* ── Activity feed ── */
.activity-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  flex-shrink: 0; margin-top: 1px;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text   { font-size: 12.5px; color: var(--text-primary); line-height: 1.4; margin-bottom: 3px; }
.activity-text strong { font-weight: 700; }
.activity-time   { font-size: 11px; color: var(--text-muted); }

/* ── Notification dot ── */
.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid white;
}

/* ── Filter buttons ── */
.filter-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ── Progress bar ── */
.progress-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 0.3s ease;
}
.progress-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* ── Version badge ── */
.version-badge-viewer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

/* ── Separator ── */
.tool-separator { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.h-separator    { height: 1px; background: var(--border); margin: 12px 0; }

/* ── Copy link box ── */
.share-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.share-link-text {
  flex: 1;
  font-size: 12px;
  color: var(--accent);
  font-family: 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  padding: 4px 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.copy-btn:hover { background: #2563EB; }
