/* ============================================================================
   public/src/features/reports/reports.css
   Hybrid Reports page styles for both Admin & Regular Users.
   Theme-adaptive (light, dark, dark-slate).
   ============================================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

body {
  font-family: "Cairo", "IBM Plex Sans Arabic", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-color: transparent;
  color: var(--color-text-primary, #e0e0e0);
  padding-top: 32px;
  padding-bottom: 80px;
  padding-right: calc(var(--sidebar-collapsed-width));
  transition: padding-right 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow-x: clip;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.sidebar-expanded {
  padding-right: calc(var(--sidebar-expanded-width));
}

.reports-page-container {
  max-width: 1200px;
  margin: 0 auto;
  /* Left/right breathing room lives here instead of on `body` — `body`'s
     own right-side padding is already owned by side-menu.css, which grows
     it dynamically with the sidebar's collapsed/expanded width (see
     `body { padding-right: calc(...) }` and `.sidebar-expanded`) so page
     content never sits under the sidebar. This file previously set a flat
     `padding-right: 24px` directly on `body` too — same selector, loaded
     after side-menu.css in reports.html, so it silently won the cascade
     and permanently pinned the offset at 24px regardless of the sidebar's
     actual width, which is exactly what let the expanded sidebar overlap
     the page content. Applying the padding to this inner container instead
     keeps the visual spacing intact without fighting side-menu.css for
     ownership of `body`. */
  padding-left: 24px;
  padding-right: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── HERO BANNER / PAGE HEADER ── */
.reports-hero {
  background: var(--color-surface, #1e1e1e);
  border: 1px solid var(--color-border, #333333);
  border-radius: 20px;
  padding: 26px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
  position: relative;
  overflow: hidden;
}

.reports-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent, linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899));
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--color-primary-light, rgba(59, 130, 246, 0.15));
  border: 1px solid var(--color-primary, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #3b82f6);
  flex-shrink: 0;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary, #ffffff);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-role-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--color-primary-light, rgba(59, 130, 246, 0.15));
  color: var(--color-primary, #3b82f6);
  border: 1px solid var(--color-primary, #3b82f6);
}

.hero-role-badge.admin {
  background: var(--color-admin-light, rgba(234, 179, 8, 0.15));
  color: var(--color-admin, #eab308);
  border-color: var(--color-admin, #eab308);
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-secondary, #a0a0a0);
}

/* ── STATS SUMMARY CARDS ── */
.reports-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  width: 100%;
}

.report-stat-card {
  background: var(--color-surface, #1e1e1e);
  border: 1px solid var(--color-border, #333333);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.report-stat-card:hover {
  
  border-color: var(--color-border-light, #555555);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
}

.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon-wrap.total {
  background: var(--color-primary-light, rgba(59, 130, 246, 0.15));
  color: var(--color-primary, #3b82f6);
}

.stat-icon-wrap.pending {
  background: var(--color-warning-light, rgba(245, 158, 11, 0.15));
  color: var(--color-warning, #f59e0b);
}

.stat-icon-wrap.resolved {
  background: var(--color-success-light, rgba(34, 197, 94, 0.15));
  color: var(--color-success, #22c55e);
}

.stat-icon-wrap.dismissed {
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text-secondary, #94a3b8);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary, #ffffff);
  line-height: 1.2;
}

.stat-text {
  font-size: 0.82rem;
  color: var(--color-text-secondary, #a0a0a0);
  font-weight: 500;
}

/* ── CONTROLS & TABS SECTION ── */
.reports-controls {
  background: var(--color-surface, #1e1e1e);
  border: 1px solid var(--color-border, #333333);
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}

.controls-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* Main Scope Tabs (Admin: My Quizzes vs All Reports) */
.scope-tabs {
  display: flex;
  background: var(--color-background-secondary, #262626);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--color-border, #333333);
  gap: 4px;
}

.scope-tab-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary, #a0a0a0);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.scope-tab-btn:hover {
  color: var(--color-text-primary, #ffffff);
}

.scope-tab-btn.active {
  background: var(--color-primary, #3b82f6);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Search Bar */
.search-filter-wrap {
  position: relative;
  min-width: 240px;
  flex-grow: 1;
  max-width: 380px;
}

.search-filter-input {
  width: 100%;
  padding: 9px 38px 9px 14px;
  background: var(--color-background-secondary, #262626);
  border: 1px solid var(--color-border, #333333);
  border-radius: 10px;
  color: var(--color-text-primary, #ffffff);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.search-filter-input:focus {
  outline: none;
  border-color: var(--color-primary, #3b82f6);
}

.search-icon-svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary, #707070);
  pointer-events: none;
}

/* Status Filter Pills */
.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-pill {
  background: var(--color-background-secondary, #262626);
  border: 1px solid var(--color-border, #333333);
  color: var(--color-text-secondary, #a0a0a0);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.status-pill:hover {
  background: var(--color-hover-overlay, rgba(59, 130, 246, 0.08));
  color: var(--color-text-primary, #ffffff);
}

.status-pill.active {
  background: var(--color-primary-light, rgba(59, 130, 246, 0.15));
  border-color: var(--color-primary, #3b82f6);
  color: var(--color-primary, #3b82f6);
  font-weight: 600;
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.pill-dot.all {
  background: var(--color-text-tertiary, #9ca3af);
}

.pill-dot.pending {
  background: var(--color-warning, #f59e0b);
}

.pill-dot.resolved {
  background: var(--color-success, #10b981);
}

.pill-dot.dismissed {
  background: var(--color-text-secondary, #64748b);
}

/* ── REPORTS LIST & CARDS ── */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-card {
  background: var(--color-surface, #1e1e1e);
  border: 1px solid var(--color-border, #333333);
  border-radius: 18px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}

.report-card:hover {
  border-color: var(--color-border-light, #555555);
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
}

.report-card.pending {
  border-right: 4px solid var(--color-warning, #f59e0b);
}

.report-card.resolved {
  border-right: 4px solid var(--color-success, #10b981);
}

.report-card.dismissed {
  border-right: 4px solid var(--color-text-tertiary, #64748b);
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.report-meta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.report-quiz-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-primary, #ffffff);
}

.report-q-badge {
  background: var(--color-primary-light, rgba(59, 130, 246, 0.12));
  color: var(--color-primary, #3b82f6);
  border: 1px solid var(--color-primary, #3b82f6);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.report-date {
  font-size: 0.82rem;
  color: var(--color-text-secondary, #a0a0a0);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Reason Box */
.report-reason-box {
  background: var(--color-background-secondary, #262626);
  border: 1px solid var(--color-border, #333333);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.report-reason-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-warning, #f59e0b);
  flex-shrink: 0;
}

.report-reason-text {
  font-size: 0.92rem;
  color: var(--color-text-primary, #e2e8f0);
}

/* Question Preview */
.report-question-box {
  background: var(--color-background-secondary, #262626);
  border: 1px solid var(--color-border, #333333);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-question-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary, #a0a0a0);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-question-body {
  font-size: 0.95rem;
  color: var(--color-text-primary, #f1f5f9);
  line-height: 1.6;
}

.report-question-body p {
  margin-bottom: 6px;
}

.report-question-body pre,
.report-question-body code {
  background: var(--color-background, #121212);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--color-code, #e2e8f0);
}

/* Footer / Actions */
.report-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border, #333333);
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-resolve {
  background: var(--color-success-light, rgba(16, 185, 129, 0.15));
  border: 1px solid var(--color-success, #10b981);
  color: var(--color-success, #10b981);
  padding: 7px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-resolve:hover {
  background: var(--color-success, #10b981);
  color: #ffffff;
}

.btn-dismiss {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid var(--color-border-light, #475569);
  color: var(--color-text-secondary, #94a3b8);
  padding: 7px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-dismiss:hover {
  background: var(--color-text-secondary, #64748b);
  color: #ffffff;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-badge.pending {
  background: var(--color-warning-light, rgba(245, 158, 11, 0.15));
  color: var(--color-warning, #f59e0b);
  border: 1px solid var(--color-warning, #f59e0b);
}

.status-badge.resolved {
  background: var(--color-success-light, rgba(34, 197, 94, 0.15));
  color: var(--color-success, #22c55e);
  border: 1px solid var(--color-success, #22c55e);
}

.status-badge.dismissed {
  background: rgba(148, 163, 184, 0.15);
  color: var(--color-text-secondary, #94a3b8);
  border: 1px solid var(--color-border, #475569);
}

.resolved-time-text {
  font-size: 0.78rem;
  color: var(--color-text-secondary, #a0a0a0);
}

/* ── EMPTY & LOADING STATES ── */
.reports-empty-state {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--color-surface, #1e1e1e);
  border-radius: 18px;
  border: 1px dashed var(--color-border, #333333);
}

.empty-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: var(--color-primary-light, rgba(59, 130, 246, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #3b82f6);
  margin-bottom: 4px;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary, #ffffff);
}

.empty-desc {
  font-size: 0.92rem;
  color: var(--color-text-secondary, #a0a0a0);
  max-width: 420px;
  line-height: 1.5;
}

.empty-btn-action {
  margin-top: 8px;
  background: var(--color-primary, #3b82f6);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 24px;
  border-radius: 10px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.empty-btn-action:hover {
  
  opacity: 0.92;
}

/* ── TOAST NOTIFICATION ── */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-surface, #1e293b);
  color: var(--color-text-primary, #ffffff);
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--color-border, #333333);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.3));
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-msg.error {
  background: var(--color-error-light, #7f1d1d);
  color: var(--color-error, #ef4444);
  border-color: var(--color-error, #ef4444);
}

.toast-msg.success {
  background: var(--color-success-light, #064e3b);
  color: var(--color-success, #10b981);
  border-color: var(--color-success, #10b981);
}

/* ── RESPONSIVE MEDIA QUERIES ── */
@media (max-width: 768px) {
  body {
    padding-top: 16px;
    padding-bottom: 90px;
    padding-right: 0px;
  }

  body.sidebar-expanded {
    padding-right: 16px;
  }

  .reports-page-container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .reports-hero {
    padding: 20px 18px;
  }

  .hero-icon-box {
    width: 48px;
    height: 48px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .reports-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .controls-row-top {
    flex-direction: column;
    align-items: stretch;
  }

  .search-filter-wrap {
    max-width: 100%;
  }

  .report-card {
    padding: 16px 18px;
  }
}