/* GameVox Agent Dashboard - Shared Components */

/* ─── Badges ─── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge--csam { background: rgba(220, 38, 38, 0.15); color: var(--severity-csam); }
.badge--threats { background: rgba(234, 88, 12, 0.15); color: var(--severity-threats); }
.badge--harassment { background: rgba(245, 158, 11, 0.15); color: var(--severity-harassment); }
.badge--spam { background: rgba(107, 114, 128, 0.15); color: var(--severity-spam); }
.badge--impersonation { background: rgba(139, 92, 246, 0.15); color: var(--severity-impersonation); }
.badge--malware { background: rgba(244, 63, 94, 0.15); color: var(--severity-malware); }
.badge--illegal { background: rgba(225, 29, 72, 0.15); color: var(--severity-illegal); }
.badge--tos_violation { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge--other { background: rgba(154, 160, 166, 0.15); color: var(--severity-other); }

.badge--pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge--investigating { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge--resolved { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge--dismissed { background: rgba(107, 114, 128, 0.15); color: var(--text-muted); }

.badge--active { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge--suspended { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge--banned { background: rgba(239, 68, 68, 0.15); color: var(--error); }

/* Category dot (small indicator) */
.cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-dot--csam { background: var(--severity-csam); }
.cat-dot--threats { background: var(--severity-threats); }
.cat-dot--harassment { background: var(--severity-harassment); }
.cat-dot--spam { background: var(--severity-spam); }
.cat-dot--impersonation { background: var(--severity-impersonation); }
.cat-dot--malware { background: var(--severity-malware); }
.cat-dot--illegal { background: var(--severity-illegal); }
.cat-dot--tos_violation { background: #a78bfa; }
.cat-dot--other { background: var(--severity-other); }

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--hover-overlay);
  border-color: var(--text-muted);
}

.btn--danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.btn--danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
}

.btn--success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.btn--success:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.25);
}

.btn--warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.btn--warning:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.25);
}

.btn--ghost {
  background: none;
  color: var(--text-secondary);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--hover-overlay);
}

.btn--sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn--sm svg {
  width: 14px;
  height: 14px;
}

.btn--xs {
  padding: 2px 8px;
  font-size: 11px;
}

.btn--icon {
  padding: 6px;
}

.btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ─── Form Controls ─── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  padding: 7px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  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='%239aa0a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ─── Cards ─── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.card__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
}

.card__body {
  padding: 14px;
}

/* ─── Modal ─── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal__title {
  font-size: 16px;
  font-weight: 700;
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.modal__close:hover {
  color: var(--text);
  background: var(--hover-overlay);
}

.modal__body {
  padding: 20px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ─── Toast Notifications ─── */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in 300ms ease forwards;
  min-width: 280px;
  max-width: 400px;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--error); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--info { border-left: 3px solid #60a5fa; }

.toast.leaving {
  animation: toast-out 300ms ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ─── Keyboard Shortcut Overlay ─── */

.kbd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}

.kbd-overlay__content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 24px 32px;
  max-width: 600px;
  width: 100%;
}

.kbd-overlay__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.kbd-overlay__section {
  margin-bottom: 16px;
}

.kbd-overlay__section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kbd-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.kbd-row__label {
  font-size: 13px;
  color: var(--text-secondary);
}

.kbd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* ─── Tabs ─── */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
}

.tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
  font-family: var(--font);
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--primary);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px 1px 0 0;
}

/* ─── Tooltip ─── */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 500;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ─── Loading ─── */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-elevated) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Checkbox ─── */

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 3px;
  background: var(--bg-tertiary);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.checkbox input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
