/* ============================================================
   Testimonials admin page — list, add/edit drawer, delete confirm.
   Reuses shared tokens/classes from global.css, admin.css, and
   portfolio.css (.field, .btn-*, .spinner, .toast, .skeleton-row,
   .required-mark, .char-count, .dashboard-error).
   ============================================================ */

.ts-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 14.5px;
}

.ts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ts-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.ts-card.is-disabled {
  opacity: 0.55;
}

.ts-card-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light, #EEF0FF);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-card-body {
  flex: 1;
  min-width: 0;
}

.ts-card-quote {
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 8px;
  color: var(--text, #1a1a2e);
}

.ts-card-person {
  font-size: 13px;
  color: var(--muted);
}

.ts-card-person .ts-card-name {
  font-weight: 600;
  color: var(--text, #1a1a2e);
}

.ts-card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  margin-top: 8px;
}

.ts-card-status.is-on {
  background: rgba(46, 175, 108, 0.12);
  color: #2EAF6C;
}

.ts-card-status.is-off {
  background: rgba(120, 120, 130, 0.12);
  color: var(--muted);
}

.ts-card-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ts-icon-btn:hover {
  background: var(--surface);
  color: var(--text, #1a1a2e);
}

.ts-icon-btn.ts-icon-btn-danger:hover {
  background: rgba(216, 58, 94, 0.08);
  color: var(--danger);
  border-color: var(--danger);
}

.ts-icon-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- Toggle switch (enable/disable) ---- */
.ts-toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.ts-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ts-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ts-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.ts-toggle-switch input:checked + .ts-toggle-slider {
  background: var(--primary);
}

.ts-toggle-switch input:checked + .ts-toggle-slider::before {
  transform: translateX(16px);
}

.ts-toggle-switch input:disabled + .ts-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Drawer form toggle (Add/Edit form's "Show on homepage") ---- */
.ts-toggle-field {
  display: flex;
  align-items: center;
}

.ts-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.ts-toggle-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---- Add/Edit drawer ---- */
.ts-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 25, 0.45);
  z-index: 60;
  align-items: center;
  justify-content: flex-end;
}

.ts-drawer-overlay.visible {
  display: flex;
}

.ts-drawer {
  background: #fff;
  width: 100vw;
  max-width: 100vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: ts-slide-in 0.2s ease;
}

@keyframes ts-slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.ts-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.ts-drawer-header h2 {
  font-size: 18px;
  margin: 0;
}

.ts-drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}

.ts-drawer-close:hover { color: var(--text, #1a1a2e); }

.ts-drawer-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.ts-drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ---- Delete confirm ---- */
.ts-confirm-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 380px;
  width: calc(100% - 32px);
}

.ts-confirm-modal h2 {
  font-size: 17px;
  margin: 0 0 8px;
}

.ts-confirm-modal p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 18px;
}

@media (max-width: 640px) {
  .ts-drawer { max-width: 100%; }
  .ts-card { flex-wrap: wrap; }
  .ts-card-actions { width: 100%; justify-content: flex-end; margin-top: 8px; }
}
