/* ═══════════════════════════════════════════════════════
   Fort Aegis — Staff Review Panel Styles
   Imports shared.css for design tokens and base styles.
   ═══════════════════════════════════════════════════════ */

/* ── Extra Design Tokens ── */
:root {
  --staff-accent: #a78bfa;
  --staff-accent-glow: rgba(167, 139, 250, 0.25);
  --warn: #fbbf24;
  --warn-glow: rgba(251, 191, 36, 0.15);
  --ban-color: #ff8a8a;
  --ban-glow: rgba(255, 138, 138, 0.15);
  --surface-deep: rgba(6, 10, 22, 0.92);
  --form-bg: rgba(12, 18, 36, 0.7);
  --pending-color: #fbbf24;
  --approved-color: #7dffb3;
  --denied-color: #ff8a8a;
}

/* ── Pure-CSS safety reveal ── */
@keyframes reveal-body { to { opacity: 1; } }
@keyframes reveal-container { to { visibility: visible; } }

/* ── Page Layout ── */
body {
  padding: clamp(2rem, 5vw, 4rem) 1rem;
  animation: reveal-body 0.5s ease 2.5s both;
}
body.loaded {
  animation: none;
  opacity: 1;
}
body.loaded .container {
  visibility: visible;
  animation: none;
}

.container {
  width: min(100%, 800px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  visibility: hidden;
  animation: reveal-container 0s linear 2.8s both;
}

/* ── Page Header ── */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  width: 80px;
  height: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(110, 159, 255, 0.5));
  animation: float 5s ease-in-out infinite;
}

.logo-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(167, 139, 250, 0.2);
  animation: drift 20s linear infinite;
}
.logo-ring--reverse {
  inset: -16px;
  border-style: dotted;
  border-color: rgba(167, 139, 250, 0.1);
  animation-direction: reverse;
  animation-duration: 30s;
}

.logo-glow-orb {
  position: absolute;
  width: 130%;
  height: 130%;
  top: -15%;
  left: -15%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(167, 139, 250, 0.12) 0%,
    rgba(167, 139, 250, 0.04) 40%,
    transparent 70%);
  animation: glow-pulse 4s ease-in-out infinite;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--staff-accent);
  margin-bottom: 0.3rem;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-soft);
  max-width: 42ch;
  margin: 0 auto;
  line-height: 1.6;
}

.header-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--staff-accent), transparent);
  margin: 1.2rem auto 0;
  opacity: 0.5;
}

/* ── Hero Card ── */
.hero-card {
  text-align: center;
  padding: 2.5rem 2rem;
}
.hero-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.hero-copy {
  margin-bottom: 1.5rem;
}
.hint {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Card Badge Variants ── */
.card-badge--danger {
  background: var(--danger-glow);
  color: var(--danger);
}

/* ── User Bar ── */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}
.user-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--staff-accent);
}
.user-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}
.user-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--staff-accent);
  font-weight: 600;
}
.rank-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--staff-accent);
  box-shadow: 0 0 8px var(--staff-accent-glow);
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ── Dashboard Section ── */
#dashboardSection {
  padding: 2rem;
}
#dashboardSection h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.dashboard-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

/* ── Case Display ── */
.case-card {
  background: var(--surface-deep);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.25rem;
  position: relative;
}
.case-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--staff-accent);
}
.case-card--warn::before {
  background: var(--warn);
}
.case-card--ban::before {
  background: var(--ban-color);
}

.case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.case-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.case-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.case-type-badge--warn {
  background: var(--warn-glow);
  color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.case-type-badge--ban {
  background: var(--ban-glow);
  color: var(--ban-color);
  border: 1px solid rgba(255, 138, 138, 0.25);
}
.case-type-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Case Meta Grid ── */
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.case-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.case-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.case-meta-value {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.4;
}

/* ── Appeal Answers Section ── */
.case-answers {
  background: var(--form-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.case-answers h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--staff-accent);
  margin: 0 0 1rem;
}
.answer-block {
  margin-bottom: 1rem;
}
.answer-block:last-child {
  margin-bottom: 0;
}
.answer-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.answer-text {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.answer-badge--yes {
  background: var(--warn-glow);
  color: var(--warn);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.answer-badge--no {
  background: rgba(110, 159, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(110, 159, 255, 0.2);
}

/* ── Case Actions (History, Release) ── */
.case-actions-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* ── Decision Section ── */
.decision-section {
  background: var(--form-bg);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}
.decision-section h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-main);
  margin: 0 0 0.75rem;
}
.decision-reason-wrap {
  margin-bottom: 1rem;
}
.decision-reason-wrap label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}
.decision-reason-wrap textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.decision-reason-wrap textarea:focus {
  outline: none;
  border-color: var(--staff-accent);
  box-shadow: 0 0 0 3px var(--staff-accent-glow);
}
.decision-reason-wrap textarea::placeholder {
  color: var(--text-dim);
}

.decision-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-approve {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.75), rgba(22, 163, 74, 0.75));
  border-color: rgba(34, 197, 94, 0.4);
  color: #fff;
}
.btn-approve:hover {
  box-shadow: 0 4px 24px rgba(34, 197, 94, 0.25);
  transform: translateY(-2px);
}

.btn-deny {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.75), rgba(220, 38, 38, 0.75));
  border-color: rgba(239, 68, 68, 0.4);
  color: #fff;
}
.btn-deny:hover {
  box-shadow: 0 4px 24px rgba(239, 68, 68, 0.25);
  transform: translateY(-2px);
}

/* ── My Cases List ── */
.my-cases-list {
  margin-top: 1rem;
}
.my-case-item {
  background: var(--surface-deep);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.my-case-item:hover {
  border-color: var(--surface-border-hover);
  background: rgba(12, 20, 42, 0.95);
}
.my-case-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.my-case-user {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}
.my-case-detail {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.my-case-arrow {
  color: var(--text-dim);
  transition: transform 0.2s ease;
}
.my-case-item:hover .my-case-arrow {
  transform: translateX(3px);
  color: var(--staff-accent);
}

/* ── No Cases Message ── */
.no-cases {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
}
.no-cases-icon {
  margin-bottom: 0.75rem;
  color: var(--staff-accent);
  opacity: 0.5;
}
.no-cases h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 0.4rem;
}
.no-cases p {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ── Skeleton Loaders ── */
.skeleton-card {
  background: var(--surface-deep);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}
.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}
.skeleton-line:nth-child(1) { width: 50%; }
.skeleton-line:nth-child(2) { width: 80%; }
.skeleton-line:nth-child(3) { width: 65%; }
.skeleton-line:last-child { margin-bottom: 0; width: 40%; }

/* ── History Modal ── */
.modal-card--wide {
  max-width: 700px;
  width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-border);
  flex-shrink: 0;
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* ── History Table ── */
.history-section {
  margin-bottom: 1.5rem;
}
.history-section:last-child {
  margin-bottom: 0;
}
.history-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--staff-accent);
  margin-bottom: 0.75rem;
}
.history-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.25rem;
}
.history-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.history-item--warn::before { background: var(--warn); }
.history-item--ban::before { background: var(--ban-color); }
.history-item--active::before { background: var(--accent); }
.history-item--inactive::before { background: var(--text-dim); }
.history-item--pending::before { background: var(--pending-color); }
.history-item--approved::before { background: var(--approved-color); }
.history-item--denied::before { background: var(--denied-color); }

.history-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.history-item-type {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
}
.history-item-date {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.history-item-detail {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* ── Status Badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-badge--pending {
  background: rgba(251, 191, 36, 0.12);
  color: var(--pending-color);
  border: 1px solid rgba(251, 191, 36, 0.2);
}
.status-badge--approved {
  background: var(--success-glow);
  color: var(--approved-color);
  border: 1px solid rgba(125, 255, 179, 0.2);
}
.status-badge--denied {
  background: var(--danger-glow);
  color: var(--denied-color);
  border: 1px solid rgba(255, 138, 138, 0.2);
}
.status-badge--active {
  background: rgba(110, 159, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(110, 159, 255, 0.2);
}
.status-badge--inactive {
  background: rgba(142, 164, 204, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(142, 164, 204, 0.15);
}

/* ── Status Toast ── */
.status-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  font-size: 0.88rem;
  color: var(--text-soft);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: min(90vw, 480px);
}
.status-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.status-toast.status-error {
  border-color: rgba(255, 138, 138, 0.3);
  color: var(--danger);
}
.status-toast.status-success {
  border-color: rgba(125, 255, 179, 0.2);
  color: var(--success);
}

/* ── History utility classes ── */
.history-title {
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--text-main);
}
.history-empty {
  color: var(--text-dim);
  font-size: 0.88rem;
}
.history-error {
  color: var(--danger);
  text-align: center;
}
.history-item-row--mt {
  margin-top: 0.3rem;
}
.history-item-detail--dim {
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ── Case type badge — small variant ── */
.case-type-badge--sm {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

/* ── Decision result card ── */
.decision-result-body {
  text-align: center;
  padding: 1.5rem;
}
.decision-result-icon {
  margin-bottom: 0.75rem;
}
.decision-result-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}
.decision-result-desc {
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ── Back Button ── */
.back-btn-wrap {
  text-align: center;
  margin-top: 2rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .container {
    width: 100%;
  }
  .case-meta {
    grid-template-columns: 1fr;
  }
  .dashboard-actions {
    flex-direction: column;
  }
  .decision-buttons {
    flex-direction: column;
  }
  .case-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .modal-card--wide {
    max-height: 90vh;
    width: 95vw;
  }
}

@media (max-width: 500px) {
  .logo-wrap {
    width: 100px;
    height: 100px;
  }
  .logo {
    width: 64px;
  }
  .user-bar {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  .user-bar-left {
    flex-direction: column;
  }
}
