/* ================================
   QUESTIONS TABLE - Shared & Desktop
   ================================ */

.questions-management-page .table-section {
  background: var(--theme-card-bg, var(--qm-surface));
  border-radius: var(--qm-radius, 12px);
  box-shadow: var(--qm-shadow);
  border: 1px solid var(--theme-border-color, var(--qm-border));
  overflow: hidden;
}

/* Dark theme: content section uses rgba(58, 56, 56, 0.95) */
body.night-mode .questions-management-page .table-section {
  background: rgba(58, 56, 56, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Dark theme: ensure all table and card text is readable */
body.night-mode .questions-management-page .table-header-title,
body.night-mode .questions-management-page .table-section .table-header h2.table-header-title {
  color: rgba(255, 255, 255, 0.98) !important;
}
body.night-mode .questions-management-page .table-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
body.night-mode .questions-management-page .user-table td {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
body.night-mode .questions-management-page .user-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}
body.night-mode .questions-management-page .all-users-table-container,
body.night-mode .questions-management-page .user-table td[colspan],
body.night-mode .questions-management-page .questions-loading-state,
body.night-mode .questions-management-page .questions-empty-state {
  color: rgba(255, 255, 255, 0.85);
}
body.night-mode .questions-management-page .questions-card {
  background: rgba(58, 56, 56, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}
body.night-mode .questions-management-page .questions-card-text {
  color: rgba(255, 255, 255, 0.95);
}
body.night-mode .questions-management-page .questions-card-meta {
  color: rgba(255, 255, 255, 0.8);
}
body.night-mode .questions-management-page .questions-card-badge {
  color: #bb86fc;
  background: rgba(187, 134, 252, 0.2);
}
body.night-mode .questions-management-page .questions-mobile-cards .questions-action-buttons {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Title: override global .table-section h2 / .table-header h2 so dark theme has visible text */
.questions-management-page .table-header-title,
.questions-management-page .table-section .table-header h2.table-header-title {
  color: var(--theme-text-primary, var(--qm-text)) !important;
  font-size: 1.35rem;
  font-weight: 700;
}

.questions-management-page .table-header {
  border-bottom-color: var(--qm-border);
}

.questions-management-page .table-container {
  border: none;
  border-radius: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table header theme - uses theme primary */
.questions-management-page .user-table thead {
  background: linear-gradient(135deg, var(--qm-primary, var(--theme-primary)) 0%, var(--qm-primary-dark, var(--theme-primary-dark)) 100%);
}

.questions-management-page .user-table th {
  color: #fff;
  padding: 0.875rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.questions-management-page .user-table td {
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  color: var(--qm-text-muted);
  vertical-align: middle;
}

.questions-management-page .user-table tbody tr:hover {
  background: var(--theme-sidebar-hover-bg, rgba(0, 0, 0, 0.04));
}

/* Action buttons container */
.questions-action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Scoped button designs for Questions table */
.questions-management-page .questions-action-buttons .btn {
  min-height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.questions-management-page .questions-action-buttons .btn-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Edit / Update button */
.questions-management-page .questions-action-buttons .btn-update {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.35);
}

.questions-management-page .questions-action-buttons .btn-update:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
  transform: translateY(-1px);
}

.questions-management-page .questions-action-buttons .btn-update:active:not(:disabled) {
  transform: translateY(0);
}

/* Delete button */
.questions-management-page .questions-action-buttons .btn-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.questions-management-page .questions-action-buttons .btn-delete:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.questions-management-page .questions-action-buttons .btn-delete:active:not(:disabled) {
  transform: translateY(0);
}

/* Empty state */
.questions-management-page .all-users-table-container,
.questions-management-page .user-table td[colspan] {
  text-align: center;
  padding: 2.5rem 1rem !important;
  color: var(--qm-text-muted);
  font-size: 1rem;
}

/* Loading & empty states */
.questions-management-page .questions-loading-state,
.questions-management-page .questions-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--qm-text-muted);
  font-size: 1rem;
}

/* ================================
   MOBILE CARD LIST (hidden on desktop)
   ================================ */

.questions-mobile-cards {
  display: none;
}

.questions-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.questions-card {
  background: var(--qm-surface);
  border: 1px solid var(--qm-border);
  border-radius: var(--qm-radius-sm, 8px);
  padding: 1rem;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s ease;
}

.questions-card:hover {
  box-shadow: var(--shadow-md, 0 4px 14px rgba(0, 0, 0, 0.1));
}

.questions-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.questions-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--qm-primary);
  background: var(--theme-sidebar-active-bg, rgba(0, 0, 0, 0.06));
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.questions-card-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--qm-text);
  line-height: 1.4;
  word-break: break-word;
}

.questions-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--qm-text-muted);
}

.questions-card-meta .badge-yes,
.questions-card-meta .badge-no {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.questions-management-page .questions-card-meta .badge-yes {
  background: var(--theme-sidebar-active-bg, rgba(76, 175, 80, 0.2));
  color: var(--success-color, #4caf50);
}

.questions-management-page .questions-card-meta .badge-no {
  background: var(--theme-input-bg);
  color: var(--danger-color, #f44336);
  border: 1px solid var(--danger-color, #f44336);
}

.questions-mobile-cards .questions-action-buttons {
  justify-content: flex-start;
  padding-top: 0.25rem;
  border-top: 1px solid var(--qm-border);
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */

@media (max-width: 768px) {
  .questions-management-page .table-section {
    padding: 1rem;
  }

  .questions-management-page .questions-table-desktop {
    display: none;
  }

  .questions-management-page .questions-mobile-cards {
    display: block;
  }

  .questions-management-page .questions-action-buttons {
    flex-direction: row;
    gap: 0.4rem;
  }

  .questions-management-page .questions-action-buttons .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .questions-management-page .table-header-title {
    font-size: 1.15rem;
  }
}
