/* ============================================================
   INFLUENCER BOOSTERX — COMPONENTS CSS
   Buttons, Cards, Badges, Modals, Forms, Platform Chips
   ============================================================ */

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 20px;
  border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none; font-family: var(--font-sans);
  transition: all var(--transition-base); position: relative; overflow: hidden;
  white-space: nowrap; user-select: none;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background var(--transition-fast);
}
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(168,85,247,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(168,85,247,0.5); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: white;
  box-shadow: 0 4px 16px rgba(244,63,94,0.3);
}
.btn-danger:hover { box-shadow: 0 6px 24px rgba(244,63,94,0.5); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 10px; width: 40px; height: 40px; border-radius: var(--radius-md); }
.btn-icon-sm { padding: 7px; width: 32px; height: 32px; border-radius: var(--radius-sm); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm svg { width: 14px; height: 14px; }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-purple { background: rgba(168,85,247,0.15); color: var(--purple-400); border: 1px solid rgba(168,85,247,0.2); }
.badge-cyan { background: rgba(6,182,212,0.12); color: var(--cyan-400); border: 1px solid rgba(6,182,212,0.2); }
.badge-pink { background: rgba(236,72,153,0.12); color: var(--pink-400); border: 1px solid rgba(236,72,153,0.2); }
.badge-emerald { background: rgba(16,185,129,0.12); color: var(--emerald-400); border: 1px solid rgba(16,185,129,0.2); }
.badge-amber { background: rgba(245,158,11,0.12); color: var(--amber-400); border: 1px solid rgba(245,158,11,0.2); }
.badge-rose { background: rgba(244,63,94,0.12); color: var(--rose-400); border: 1px solid rgba(244,63,94,0.2); }
.badge-subtle { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* --- Platform Chips --- */
.platform-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.platform-chip .chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--platform-color, #888);
}

/* --- Platform Account Card --- */
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: all var(--transition-base); cursor: pointer;
}
.account-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--platform-grad, var(--grad-primary));
  opacity: 0; transition: opacity var(--transition-base);
}
.account-card:hover { border-color: var(--border-medium); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.account-card:hover::after { opacity: 1; }
.account-card.connected { border-color: rgba(16,185,129,0.2); }
.account-card.disconnected { opacity: 0.55; }
.account-card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.account-platform-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: var(--platform-grad, var(--bg-card));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.account-handle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.account-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600;
  margin-left: auto;
}
.account-status.connected { color: var(--emerald-400); }
.account-status.disconnected { color: var(--text-muted); }
.account-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.account-status.connected .account-status-dot {
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
  animation: pulse 2s ease-in-out infinite;
}
.account-status.disconnected .account-status-dot { background: var(--text-muted); }

.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.account-stat-item { text-align: center; }
.account-stat-value { font-size: 1.05rem; font-weight: 800; font-family: var(--font-display); }
.account-stat-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }
.account-card-actions { display: flex; gap: 8px; margin-top: 18px; }

/* --- Post Item --- */
.post-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast); cursor: pointer;
}
.post-item:hover { border-color: var(--border-medium); background: var(--bg-card-hover); }
.post-thumb {
  width: 60px; height: 60px; border-radius: var(--radius-sm);
  background: var(--bg-glass-strong); flex-shrink: 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.post-info { flex: 1; min-width: 0; }
.post-title { font-size: 0.875rem; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-metrics { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.post-metric { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-secondary); }
.post-metric svg { width: 13px; height: 13px; }
.post-status { margin-left: auto; flex-shrink: 0; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
}
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-card); border: 1px solid var(--border-medium);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: 0.875rem; transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(168,85,247,0.15); }
.form-input::placeholder { color: var(--text-muted); }
.form-select {
  width: 100%; padding: 11px 14px;
  background: var(--bg-card); border: 1px solid var(--border-medium);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: 0.875rem; cursor: pointer; outline: none;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
.form-select:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(168,85,247,0.15); }
.form-textarea {
  width: 100%; padding: 11px 14px; min-height: 100px;
  background: var(--bg-card); border: 1px solid var(--border-medium);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: 0.875rem; resize: vertical; outline: none;
  transition: all var(--transition-fast);
}
.form-textarea:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(168,85,247,0.15); }
.form-textarea::placeholder { color: var(--text-muted); }

/* --- Toggle Switch --- */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-medium); border-radius: 99px;
  transition: all var(--transition-base);
}
.toggle-slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--purple-500); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity var(--transition-base);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 32px; width: 100%; max-width: 520px;
  position: relative; box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-spring);
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.modal-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 24px; }

/* --- Toast --- */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1100; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg); min-width: 280px; max-width: 380px;
  pointer-events: all; cursor: pointer;
  animation: toastSlideIn 0.35s var(--transition-spring) forwards;
}
.toast.removing { animation: toastSlideOut 0.25s ease-in forwards; }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-message { flex: 1; font-size: 0.875rem; font-weight: 500; }
.toast-success { border-color: rgba(16,185,129,0.3); }
.toast-success .toast-icon { color: var(--emerald-400); }
.toast-error { border-color: rgba(244,63,94,0.3); }
.toast-error .toast-icon { color: var(--rose-400); }
.toast-info { border-color: rgba(168,85,247,0.3); }
.toast-info .toast-icon { color: var(--purple-400); }

/* --- Filter Bar --- */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.filter-btn {
  padding: 7px 14px; border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-btn:hover { border-color: var(--border-medium); color: var(--text-primary); }
.filter-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(6,182,212,0.15));
  border-color: rgba(168,85,247,0.4); color: var(--text-primary);
}

/* --- Empty State --- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 24px; text-align: center; gap: 12px;
}
.empty-state-icon { font-size: 3.5rem; opacity: 0.4; margin-bottom: 4px; }
.empty-state-title { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); }
.empty-state-subtitle { font-size: 0.875rem; color: var(--text-muted); max-width: 320px; }

/* --- Sparkline Mini Chart --- */
.sparkline-wrap { margin-top: 12px; height: 40px; position: relative; }

/* --- Progress Bar --- */
.progress-bar-wrap { height: 6px; background: var(--border-subtle); border-radius: 999px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: 999px;
  background: var(--grad-primary);
  transition: width 1s var(--transition-slow);
}

/* --- Avatar Stack --- */
.avatar-stack { display: flex; }
.avatar-stack .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad-primary); color: white;
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
  margin-left: -8px;
}
.avatar-stack .avatar:first-child { margin-left: 0; }

/* --- Divider Line --- */
.divider { height: 1px; background: var(--border-subtle); width: 100%; }

/* --- Tooltip --- */
.tooltip-wrap { position: relative; }
.tooltip-wrap .tooltip-text {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); white-space: nowrap;
  background: var(--bg-surface); border: 1px solid var(--border-medium);
  color: var(--text-primary); font-size: 0.72rem; font-weight: 500;
  padding: 5px 10px; border-radius: var(--radius-sm);
  pointer-events: none; opacity: 0; transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-md); z-index: 10;
}
.tooltip-wrap:hover .tooltip-text { opacity: 1; }

/* --- Search Bar --- */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border-medium);
  border-radius: var(--radius-md); padding: 9px 14px;
  transition: all var(--transition-fast);
}
.search-bar:focus-within { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(168,85,247,0.12); }
.search-bar svg { color: var(--text-muted); width: 16px; height: 16px; flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 0.875rem;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* --- Trend Indicator --- */
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 0.75rem; font-weight: 700; }
.trend.up { color: var(--emerald-400); }
.trend.down { color: var(--rose-400); }
.trend svg { width: 12px; height: 12px; }

/* --- Platform Add Card --- */
.add-platform-card {
  background: var(--bg-card); border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg); padding: 32px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; cursor: pointer;
  transition: all var(--transition-base); min-height: 200px;
}
.add-platform-card:hover {
  border-color: var(--purple-500); background: rgba(168,85,247,0.05);
  transform: translateY(-3px);
}
.add-platform-card .add-icon {
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(6,182,212,0.1));
  border: 1px solid rgba(168,85,247,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}

/* --- Metric Row --- */
.metric-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
}
.metric-row:last-child { border-bottom: none; }
.metric-row-label { font-size: 0.85rem; color: var(--text-secondary); }
.metric-row-value { font-size: 0.95rem; font-weight: 700; }

/* --- Heatmap Cell --- */
.heatmap-grid { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; margin-top: 8px; }
.heatmap-cell {
  aspect-ratio: 1; border-radius: 3px;
  background: var(--border-subtle);
  transition: background var(--transition-fast);
}
.heatmap-cell.heat-1 { background: rgba(168,85,247,0.15); }
.heatmap-cell.heat-2 { background: rgba(168,85,247,0.35); }
.heatmap-cell.heat-3 { background: rgba(168,85,247,0.6); }
.heatmap-cell.heat-4 { background: rgba(168,85,247,0.85); }
.heatmap-cell.heat-5 { background: var(--purple-500); box-shadow: 0 0 6px rgba(168,85,247,0.5); }

/* --- Tab Bar --- */
.tab-bar { display: flex; gap: 4px; background: var(--bg-card); border-radius: var(--radius-md); padding: 4px; }
.tab-btn {
  flex: 1; padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition-fast); text-align: center;
}
.tab-btn.active { background: var(--bg-glass-strong); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* --- Tip Card --- */
.tip-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 22px;
  transition: all var(--transition-base); position: relative; overflow: hidden;
}
.tip-card:hover { border-color: var(--border-medium); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tip-card-accent {
  position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: var(--grad-primary);
}
.tip-card-icon { font-size: 2rem; margin-bottom: 12px; }
.tip-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.tip-card-body { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.tip-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.tip-difficulty { display: flex; gap: 3px; }
.tip-difficulty span {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--border-medium);
}
.tip-difficulty span.filled { background: var(--purple-500); }

/* --- Scrollable List --- */
.scrollable-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.scrollable-list::-webkit-scrollbar { width: 4px; }

/* --- Settings Section --- */
.settings-section {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
}
.settings-section-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-glass);
}
.settings-section-title { font-weight: 700; font-size: 0.95rem; }
.settings-section-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info { flex: 1; }
.settings-row-label { font-size: 0.875rem; font-weight: 600; }
.settings-row-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
