/* ==========================================================================
   PREMIUM DESIGN SYSTEM (HSL Tailored Theme)
   ========================================================================== */
:root {
  --isenberg-maroon: #881c1c;
  --isenberg-black: #212721;
  --isenberg-white: #ffffff;
  --isenberg-maroon-dark: #6f1717;
  --isenberg-maroon-darker: #5c1313;
  --isenberg-cool-grey: #63666a;
  
  --neutral-900: #212721;
  --neutral-700: #44474b;
  --neutral-500: #63666a;
  --neutral-300: #c7c8ca;
  --neutral-100: #f1f1f2;
  --neutral-050: #f8f8f9;

  --status-error: #9d2235;
  --status-success: #2e7d32;
  --status-warning: #b26a00;

  --bg-primary: var(--neutral-050);
  --bg-secondary: var(--isenberg-white);
  --text-main: var(--neutral-900);
  --text-muted: var(--neutral-500);
  --text-inverse: var(--isenberg-white);
  
  --accent-primary: var(--isenberg-maroon);
  --accent-primary-hover: var(--isenberg-maroon-dark);
  --accent-secondary: var(--isenberg-cool-grey);
  
  --glass-bg: #ffffff;
  --glass-border: var(--neutral-300);
  --glass-shadow: rgba(0, 0, 0, 0.1);
  --card-radius: 4px;
  --transition-smooth: all 0.2s ease;
  
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: "Open Sans", Arial, Helvetica, sans-serif;
  --font-title: var(--font-serif);
  --font-body: var(--font-sans);
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-size: 100%;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Vibrant Radial Background Gradient */
.bg-gradient-radial { display: none; }

/* App Wrapper */
.app-container {
  width: 100%;
  max-width: 900px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  justify-content: center;
}

/* ==========================================================================
   HEADER & PROGRESS BAR
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 10px var(--isenberg-maroon));
}

.logo-text h1 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--accent-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--accent-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.progress-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 180px;
}

.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: hsl(230, 20%, 18%);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--neutral-300);
}

.progress-indicator {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 10px;
  box-shadow: 0 0 8px var(--accent-primary);
  transition: width 0.4s ease-out;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   MAIN PREMIUM CARD CONTAINER
   ========================================================================== */
.main-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px var(--glass-shadow);
  border-radius: var(--card-radius);
  padding: 40px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-smooth);
}

/* SPA Phase Visibility Controls */
.survey-phase {
  display: none;
  flex-direction: column;
  height: 100%;
  animation: fadeInSlide 0.5s forwards cubic-bezier(0.19, 1, 0.22, 1);
}

.survey-phase.active {
  display: flex;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   CARD TYPOGRAPHY
   ========================================================================== */
.card-header {
  margin-bottom: 28px;
}

.card-header h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ==========================================================================
   SCROLLABLE CONSENT BOX & INFO BOXES
   ========================================================================== */
.consent-content {
  background: var(--neutral-100);
  border: 1px solid var(--neutral-300);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  max-height: 250px;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 0.9rem;
}

.consent-content h3 {
  font-family: var(--font-title);
  color: var(--accent-secondary);
  font-size: 1.05rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.consent-content p {
  margin-bottom: 12px;
  color: var(--text-main);
}

.consent-content p:last-child {
  margin-bottom: 0;
}

/* Custom Scrollbar for Scrollable Elements */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
  transition: var(--transition-smooth);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.info-alert {
  background: var(--isenberg-maroon);
  border: 1px solid var(--isenberg-maroon);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--isenberg-maroon);
  animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 4px var(--isenberg-maroon); }
  to { box-shadow: 0 0 10px var(--isenberg-maroon); }
}

/* ==========================================================================
   BUTTON STYLES
   ========================================================================== */
.button-row {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
}

.btn {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--text-main);
  box-shadow: 0 4px 15px var(--isenberg-maroon);
  border: 1px solid var(--neutral-300);
}

.btn-primary:hover {
  background: var(--accent-primary);
  box-shadow: 0 6px 20px var(--isenberg-maroon);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--neutral-300);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--neutral-300);
  color: var(--text-main);
  border-color: var(--neutral-300);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   FORM INPUT STYLES (Demographics Phase)
   ========================================================================== */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

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

.form-label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
}

.required {
  color: var(--color-danger);
  margin-left: 4px;
}

.form-input, .form-select {
  font-family: var(--font-body);
  background: var(--neutral-300);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.form-input:focus, .form-select:focus {
  outline: none;
  background: var(--neutral-300);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--isenberg-maroon);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.input-helper {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Slider (Tech Expertise) Custom Styling */
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--neutral-100);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--neutral-300);
}

.slider-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.form-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 5px;
  background: hsl(230, 20%, 25%);
  outline: none;
  transition: background 0.3s;
}

.form-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-secondary);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-secondary);
  transition: var(--transition-smooth);
}

.form-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent-secondary-hover);
}

.slider-value-bubble {
  font-size: 0.85rem;
  color: var(--text-main);
  text-align: right;
  margin-top: 4px;
}

.slider-value-bubble strong {
  color: var(--accent-secondary);
}

/* ==========================================================================
   TREATMENT STIMULUS UI (AI Dashboard Mockup)
   ========================================================================== */
.stimulus-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.scenario-text {
  background: var(--isenberg-maroon);
  border-left: 4px solid var(--accent-primary);
  padding: 16px 20px;
  border-radius: 0 10px 10px 0;
  line-height: 1.6;
  font-size: 0.92rem;
}

.scenario-text strong {
  color: var(--text-main);
}

.interactive-stimulus {
  background: hsl(230, 24%, 10%);
  border: 1px solid var(--neutral-300);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stimulus-header {
  background: var(--neutral-300);
  border-bottom: 1px solid var(--neutral-300);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stimulus-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-secondary);
}

.stimulus-status-dot.animated {
  animation: glowAnimation 1.5s infinite alternate;
}

@keyframes glowAnimation {
  from { box-shadow: 0 0 2px var(--accent-secondary); }
  to { box-shadow: 0 0 10px var(--accent-secondary); }
}

.stimulus-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stimulus-body {
  font-size: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stimulus-card {
  background: var(--neutral-300);
  border: 1px solid var(--neutral-300);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.alert-card {
  border-left: 4px solid var(--accent-secondary);
  background: var(--accent-primary);
}

.card-emoji {
  font-size: 1.8rem;
}

.card-info h4 {
  font-family: var(--font-title);
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.rec-highlight {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-top: 2px;
}

.stimulus-label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 8px;
  display: block;
}

.treatment-btn-group {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.treatment-btn {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 10px;
  background: var(--neutral-300);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.treatment-btn:hover {
  background: var(--neutral-300);
  color: var(--text-main);
}

.treatment-btn.active {
  background: var(--isenberg-maroon);
  color: var(--text-main);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 10px var(--isenberg-maroon);
}

.stimulus-result-box {
  background: var(--neutral-100);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--neutral-300);
}

.explanation-pane {
  animation: fadeIn 0.4s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.explanation-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 14px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric {
  background: var(--neutral-300);
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--neutral-300);
}

.m-val {
  display: block;
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.m-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* SHAP Chart mockup */
.shap-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shap-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shap-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shap-bar {
  height: 12px;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.shap-bar.positive {
  background: var(--accent-primary);
}

.shap-bar.negative {
  background: var(--accent-primary);
}

/* User Decision selection */
.user-decision-box {
  border-top: 1px solid var(--neutral-300);
  padding-top: 18px;
}

.decision-radios {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.decision-radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--neutral-300);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.decision-radio-option:hover {
  background: var(--neutral-300);
  border-color: var(--neutral-300);
}

.decision-radio-option input[type="radio"] {
  accent-color: var(--accent-secondary);
  width: 18px;
  height: 18px;
}

.decision-radio-option:has(input[type="radio"]:checked) {
  border-color: var(--accent-secondary);
  background: var(--isenberg-cool-grey);
}

.radio-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
}

/* ==========================================================================
   ACADEMIC LIKERT SCALES (Survey Phase)
   ========================================================================== */
.likert-instruction {
  display: flex;
  justify-content: space-between;
  background: var(--neutral-300);
  border: 1px solid var(--neutral-300);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.likert-construct-block {
  margin-top: 18px;
}

.likert-construct-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--isenberg-cool-grey);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.likert-row {
  background: var(--neutral-300);
  border: 1px solid var(--neutral-300);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  transition: var(--transition-smooth);
}

.likert-row:hover {
  background: var(--neutral-300);
  border-color: var(--neutral-300);
}

.likert-question {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Highly Interactive 7-point scale container */
.likert-options-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.likert-option-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.likert-option-bubble input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bubble-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--neutral-300);
  border: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.likert-option-bubble:hover .bubble-circle {
  background: var(--neutral-300);
  color: var(--text-main);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.bubble-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  font-weight: 500;
  display: none; /* In grid mode, we rely on core layout labels, but keep active for mobile */
}

/* Selected state styling (violet primary selected) */
.likert-option-bubble input[type="radio"]:checked + .bubble-circle {
  background: var(--accent-primary);
  color: var(--text-main);
  border-color: var(--text-main);
  box-shadow: 0 0 12px var(--accent-primary);
  animation: selectBubblePulse 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes selectBubblePulse {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Mobile responsive layout adjustment for Likert Scales */
@media (max-width: 768px) {
  .likert-options-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  .bubble-circle {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .likert-options-grid {
    display: flex;
    justify-content: space-between;
  }
  .bubble-circle {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   COMPLETION & DEBRIEF PHASE
   ========================================================================== */
.completion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 0;
}

.checkmark-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 2px solid var(--color-success);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
  animation: pulseSuccess 2s infinite alternate;
}

@keyframes pulseSuccess {
  from { box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
  to { box-shadow: 0 0 25px rgba(16, 185, 129, 0.45); }
}

.checkmark {
  color: var(--color-success);
  font-size: 2.5rem;
  font-weight: bold;
}

.completion-card h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text-main);
}

.completion-card p {
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.completion-code-box {
  background: var(--neutral-100);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 28px;
}

.code-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}

.code-display-row {
  display: flex;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.code-display-row code {
  flex: 1;
  background: var(--neutral-100);
  padding: 12px;
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-secondary);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-copy {
  background: var(--accent-primary);
  border: none;
  color: var(--text-main);
  padding: 0 20px;
  font-family: var(--font-title);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-copy:hover {
  background: var(--accent-primary-hover);
}

.code-subtext {
  font-size: 0.75rem !important;
  margin-bottom: 0 !important;
}

/* ==========================================================================
   RESEARCHER ADMIN VIEW & STATS
   ========================================================================== */
.admin-dashboard-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.4s forwards;
}

.dashboard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--neutral-300);
  padding-bottom: 14px;
}

.db-stats {
  font-size: 0.9rem;
  color: var(--text-main);
}

.db-stats strong {
  color: var(--accent-secondary);
  font-size: 1.1rem;
}

.db-actions {
  display: flex;
  gap: 10px;
}

/* Highly Professional Responsive Data Grid */
.table-scroll-container {
  overflow-x: auto;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  background: var(--neutral-100);
  max-height: 380px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.data-table th {
  background: var(--neutral-300);
  color: var(--text-main);
  font-family: var(--font-title);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-300);
}

.data-table td {
  padding: 10px 16px;
  color: var(--text-main);
  border-bottom: 1px solid var(--neutral-300);
}

.data-table tbody tr:hover {
  background: var(--neutral-300);
}

.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: hsl(145, 65%, 70%);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: hsl(355, 75%, 75%);
}

/* ==========================================================================
   MEME STIMULUS DISPLAY
   ========================================================================== */
.meme-instructions-box {
  background: var(--isenberg-maroon);
  border-left: 4px solid var(--accent-primary);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 20px;
}

.meme-stimulus-box {
  background: var(--neutral-100);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  margin-bottom: 24px;
}

.meme-media {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ==========================================================================
   FAMILIARITY RADIO (meme image page)
   ========================================================================== */
.familiar-radios {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.familiar-option {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--neutral-300);
  border: 1px solid var(--glass-border);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.familiar-option:hover {
  background: var(--neutral-300);
  border-color: var(--neutral-300);
}

.familiar-option:has(input:checked) {
  border-color: var(--accent-primary);
  background: var(--isenberg-maroon);
  color: var(--text-main);
}

.familiar-option input[type="radio"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   4-POINT LABELED SCALE (humor, irritation)
   ========================================================================== */
.scale-question {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 14px;
  line-height: 1.5;
}

.scale-question strong {
  color: var(--accent-secondary);
}

.scale-4pt {
  display: flex;
  gap: 8px;
}

.scale-opt {
  flex: 1;
  cursor: pointer;
}

.scale-opt input[type="radio"] {
  display: none;
}

.scale-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 60px;
  transition: var(--transition-smooth);
}

.scale-opt:hover .scale-btn {
  border-color: var(--accent-primary);
  color: var(--text-main);
  background: var(--isenberg-maroon);
}

.scale-opt input:checked + .scale-btn {
  background: var(--accent-primary);
  border-color: transparent;
  color: var(--text-main);
  font-weight: 700;
  box-shadow: 0 4px 14px var(--isenberg-maroon);
}

@media (max-width: 580px) {
  .scale-4pt { flex-wrap: wrap; }
  .scale-opt { flex: 0 0 calc(50% - 4px); }
}

/* ==========================================================================
   MATRIX SCALE (credibility, involvement)
   ========================================================================== */
.matrix-scale {
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.matrix-row {
  display: grid;
  grid-template-columns: 1fr repeat(4, 72px);
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--neutral-300);
  gap: 4px;
}

.matrix-row:first-child { border-top: none; }

.matrix-header-row {
  background: var(--neutral-300);
  padding: 10px 14px;
}

.matrix-row-alt {
  background: var(--neutral-300);
}

.matrix-choice-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.matrix-q-cell {
  font-size: 0.88rem;
  color: var(--text-main);
  padding-right: 12px;
  line-height: 1.45;
}

.matrix-header-row .matrix-q-cell {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.matrix-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 4px;
}

.matrix-cell input[type="radio"] { display: none; }

.radio-pip {
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-300);
  border-radius: 50%;
  display: block;
  transition: all 0.15s;
  flex-shrink: 0;
}

.matrix-cell:hover .radio-pip {
  border-color: var(--accent-primary);
  background: var(--isenberg-maroon);
}

.matrix-cell input:checked + .radio-pip {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: inset 0 0 0 4px var(--neutral-300), 0 0 8px var(--isenberg-maroon);
}

.scale-anchor-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  padding: 0 2px;
}

@media (max-width: 600px) {
  .matrix-row {
    grid-template-columns: 1fr repeat(4, 52px);
    padding: 8px 10px;
  }
  .radio-pip { width: 18px; height: 18px; }
  .matrix-q-cell { font-size: 0.82rem; }
}

/* ==========================================================================
   ATTENTION CHECK
   ========================================================================== */
.attention-check-group {
  border-top: 1px solid var(--neutral-300);
  padding-top: 20px;
}

.attention-check-label {
  color: var(--text-main) !important;
  font-style: italic;
}

/* ==========================================================================
   TEXTAREA
   ========================================================================== */
.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ==========================================================================
   CONDITION PILL (admin table)
   ========================================================================== */
.condition-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.condition-pill.animated {
  background: var(--isenberg-cool-grey);
  color: hsl(190,90%,70%);
}

.condition-pill.static {
  background: var(--isenberg-maroon);
  color: var(--isenberg-maroon);
}

/* ==========================================================================
   APP FOOTER
   ========================================================================== */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
  margin-top: auto;
}

.subtle-gear {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.subtle-gear:hover {
  color: var(--accent-secondary);
}


/* ISENBERG ADDITIONS */
.isenberg-header {
  background: var(--isenberg-maroon);
  padding: 0.75rem 1.25rem;
  border-radius: var(--card-radius);
  color: var(--isenberg-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.isenberg-name {
  font-family: var(--font-serif);
  color: var(--isenberg-white);
  font-weight: 600;
  font-size: 1.5rem;
}
.app-header.isenberg-header .logo-area, .app-header.isenberg-header .progress-container {
  color: var(--isenberg-white);
}
.app-header.isenberg-header .progress-text {
  color: var(--isenberg-white);
}
.btn-primary {
  color: var(--isenberg-white) !important;
  background: var(--isenberg-maroon) !important;
  outline: none;
}
.btn-primary:focus-visible {
  outline: 2px solid var(--isenberg-maroon);
  outline-offset: 2px;
}
.btn-secondary {
  background: var(--isenberg-white) !important;
  color: var(--isenberg-maroon) !important;
  border: 1px solid var(--isenberg-maroon) !important;
}
.btn-primary:hover {
  background: var(--isenberg-maroon-dark) !important;
}
.btn-primary:active {
  background: var(--isenberg-maroon-darker) !important;
}
.form-input, .form-select, .form-textarea {
  background: var(--isenberg-white) !important;
  color: var(--isenberg-black) !important;
  border: 1px solid var(--neutral-300) !important;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--isenberg-maroon) !important;
  box-shadow: 0 0 0 2px rgba(136, 28, 28, 0.2) !important;
}
.progress-bar-wrapper {
  background: var(--neutral-100) !important;
  border: 1px solid var(--neutral-300) !important;
}
.progress-indicator {
  background: var(--isenberg-maroon) !important;
  box-shadow: none !important;
}
.required {
  color: var(--status-error) !important;
}
.card-header h2 {
  color: var(--isenberg-black) !important;
}
.form-label {
  color: var(--isenberg-black) !important;
}
/* Likert fixes */
.bubble-circle {
  background: var(--isenberg-white) !important;
  border: 1px solid var(--neutral-300) !important;
  color: var(--isenberg-black) !important;
}
.likert-option-bubble input[type="radio"]:checked + .bubble-circle {
  background: var(--isenberg-maroon) !important;
  color: var(--isenberg-white) !important;
  border-color: var(--isenberg-maroon) !important;
  box-shadow: none !important;
}
.likert-question {
  color: var(--isenberg-black) !important;
}
.matrix-q-cell {
  color: var(--isenberg-black) !important;
}
.matrix-row-alt {
  background: var(--neutral-050) !important;
}
.matrix-header-row {
  background: var(--neutral-100) !important;
}
.radio-pip {
  border-color: var(--neutral-300) !important;
  background: var(--isenberg-white) !important;
}
.matrix-cell input:checked + .radio-pip {
  background: var(--isenberg-maroon) !important;
  border-color: var(--isenberg-maroon) !important;
  box-shadow: none !important;
}
.scale-question {
  color: var(--isenberg-black) !important;
}
.scale-btn {
  color: var(--isenberg-black) !important;
  background: var(--isenberg-white) !important;
}
.scale-opt input:checked + .scale-btn {
  background: var(--isenberg-maroon) !important;
  color: var(--isenberg-white) !important;
  border-color: var(--isenberg-maroon) !important;
}
.completion-card h2 {
  color: var(--isenberg-black) !important;
}
.checkmark-circle {
  background: var(--isenberg-white) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   FORM VALIDATION STYLING
   ========================================================================== */
.validation-banner {
  background-color: rgba(136, 28, 28, 0.1) !important;
  border-left: 4px solid var(--isenberg-maroon) !important;
  color: var(--isenberg-maroon) !important;
  padding: 12px 16px !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  margin-bottom: 20px !important;
  animation: slideIn 0.3s ease-out !important;
  text-align: left !important;
}

@keyframes slideIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.validation-error {
  border-left: 3px solid var(--isenberg-maroon) !important;
  background-color: rgba(136, 28, 28, 0.03) !important;
  padding-left: 8px !important;
  transition: all 0.2s ease !important;
}

/* ==========================================================================
   GAME UI OVERLAY CARD STYLING
   ========================================================================== */
.game-overlay-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-family: var(--font-sans);
  background-color: rgba(33, 39, 33, 0.6) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.game-start-card,
.game-over-card {
  background: rgba(33, 39, 33, 0.95); /* brand black with high opacity */
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: gameCardFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
}

@keyframes gameCardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.game-over-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game-start-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-over-subtitle,
.game-start-subtitle {
  font-size: 0.85rem;
  color: var(--neutral-300);
  margin-bottom: 24px;
  line-height: 1.5;
}

.game-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.game-stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.game-stat-card:hover {
  background: rgba(255, 255, 255, 0.1);
}

.game-stat-card.full-width {
  grid-column: span 2;
  background: rgba(136, 28, 28, 0.25); /* maroon-tinted for total score */
  border-color: rgba(136, 28, 28, 0.4);
  padding: 16px 8px;
}

.game-stat-card.full-width:hover {
  background: rgba(136, 28, 28, 0.35);
}

.game-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--neutral-300);
  margin-bottom: 4px;
}

.game-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
}

.game-stat-card.full-width .game-stat-value {
  font-size: 1.8rem;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Yellow color for coins value */
.game-stat-card:nth-child(2) .game-stat-value {
  color: #ffd54f; /* gold yellow */
}

.game-start-btn {
  display: inline-block;
  background: var(--isenberg-maroon);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-shadow: 0 4px 12px rgba(136, 28, 28, 0.3);
  font-family: var(--font-sans);
}

.game-start-btn:hover {
  background: var(--isenberg-maroon-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(136, 28, 28, 0.4);
}

.game-start-btn:active {
  background: var(--isenberg-maroon-darker) !important;
  transform: translateY(1px);
}

.game-over-notice {
  font-size: 0.8rem;
  color: var(--neutral-300);
  margin-top: 16px;
  font-style: italic;
  line-height: 1.4;
}

/* ==========================================================================
   KEYBOARD NAVIGATION & SHORTCUT LEGEND
   ========================================================================== */

/* Active Question Highlighter */
.kb-active-question {
  border-left: 4px solid var(--isenberg-maroon) !important;
  background-color: rgba(136, 28, 28, 0.04) !important;
  padding-left: 16px !important;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Highlight specifically for matrix statement rows */
.matrix-row.kb-active-question {
  border-left: 4px solid var(--isenberg-maroon) !important;
  background-color: rgba(136, 28, 28, 0.05) !important;
  box-shadow: inset 2px 0 0 var(--isenberg-maroon), 0 1px 4px rgba(0,0,0,0.05);
  padding-left: 14px !important; /* Keep aligned with regular rows */
}

/* Premium KBD shortcut style */
kbd {
  display: inline-block;
  padding: 3px 6px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--neutral-900);
  background-color: var(--isenberg-white);
  border: 1px solid var(--neutral-300);
  border-bottom: 3px solid var(--neutral-500);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  line-height: 1;
  vertical-align: middle;
}

/* Premium shortcut legend panel */
.kb-legend-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding: 12px 20px;
  background-color: var(--neutral-050);
  border: 1px dashed var(--neutral-300);
  border-radius: var(--card-radius, 4px);
  font-size: 0.8rem;
  color: var(--neutral-700);
  animation: fadeIn 0.4s ease;
  width: 100%;
  box-sizing: border-box;
}

.kb-legend-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--isenberg-maroon);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}

.kb-legend-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.kb-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kb-legend-sep {
  color: var(--neutral-300);
}

/* Matrix layout optimization: narrower spacing, wider text */
.matrix-cell {
  padding: 4px 1px !important;
  justify-content: center !important;
}

.matrix-choice-header {
  padding: 4px 1px !important;
  font-size: 0.7rem !important;
}

.matrix-q-cell {
  font-size: 0.9rem !important;
  line-height: 1.45 !important;
  padding-right: 16px !important;
  color: var(--neutral-900) !important;
}

/* Center game phase vertically when game is active */
.game-active-card {
  display: flex;
  flex-direction: column;
}

.game-active-card .survey-phase.active {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-active-card #survey-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-active-card .form-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-active-card .form-group {
  margin-bottom: 0 !important;
}

/* Custom modal styles for clear database confirmation (secure alternative to native confirm) */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}
.custom-modal-backdrop.hidden {
  display: none !important;
}
.custom-modal-card {
  background: var(--neutral-100, #1e1e1e);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  animation: modalScaleIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes modalScaleIn {
  to { transform: scale(1); }
}
.custom-modal-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main, #fff);
  margin-top: 0;
  margin-bottom: 12px;
}
.custom-modal-text {
  font-size: 0.9rem;
  color: var(--text-muted, #aaa);
  line-height: 1.5;
  margin-bottom: 20px;
}
.custom-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Button & Badge Utility Extensions */
.btn-danger {
  background: #9d2235 !important;
  color: #ffffff !important;
  border: 1px solid #9d2235 !important;
}
.btn-danger:hover {
  background: #7a1a29 !important;
  border-color: #7a1a29 !important;
}
.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: hsl(35, 85%, 70%);
}
.game-stat-pill {
  display: inline-flex;
  align-items: center;
  background: var(--neutral-300, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-main, #fff);
  white-space: nowrap;
  gap: 4px;
}
.game-stat-pill strong {
  color: var(--accent-secondary, #b388ff);
}



