/* MPFI Shiny App Custom CSS */
/* Extended with authentication and multi-test styles */

/* ==========================================================================
   General Layout
   ========================================================================== */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.content-wrapper {
  background-color: #f4f4f4;
}

/* ==========================================================================
   Well Panels
   ========================================================================== */

.well {
  background-color: white;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Headings
   ========================================================================== */

h2 {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 20px;
}

h3 {
  color: #34495e;
  font-weight: 600;
  margin-top: 20px;
}

h4 {
  color: #3c8dbc;
  font-weight: 600;
  margin-top: 15px;
}

/* ==========================================================================
   Authentication Styles
   ========================================================================== */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3c8dbc 0%, #1a5276 100%);
  padding: 20px;
}

.auth-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: 35px;
}

.auth-icon {
  font-size: 56px;
  color: #3c8dbc;
  margin-bottom: 15px;
  display: block;
}

.auth-header h2 {
  margin: 0 0 10px 0;
  color: #2c3e50;
}

.auth-subtitle {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.auth-form {
  margin-bottom: 20px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  display: block;
}

.auth-form .input-group {
  display: flex;
  width: 100%;
}

.auth-form .input-group-addon {
  background: #f8f9fa;
  border: 1px solid #ced4da;
  border-right: none;
  padding: 10px 15px;
  border-radius: 4px 0 0 4px;
  color: #666;
  display: flex;
  align-items: center;
}

.auth-form .form-control {
  border-radius: 0 4px 4px 0;
  height: 46px;
  font-size: 15px;
  border-left: none;
  flex: 1;
}

.auth-form .form-control:focus {
  border-color: #3c8dbc;
  box-shadow: 0 0 0 3px rgba(60, 141, 188, 0.15);
}

.auth-form .btn-block {
  height: 48px;
  font-size: 16px;
}

.auth-footer {
  text-align: center;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

/* Alert in auth form */
.auth-form .alert {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 14px;
}

.auth-form .alert-danger {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
}

/* ==========================================================================
   User Menu (Header)
   ========================================================================== */

.user-menu {
  display: flex;
  align-items: center;
  padding: 8px 15px;
}

.user-info {
  margin-right: 15px;
  color: #fff;
  font-size: 14px;
}

.user-info .fa {
  margin-right: 5px;
}

/* ==========================================================================
   MPFI Welcome Page - Simplified Single Test Design
   ========================================================================== */

.mpfi-welcome {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.mpfi-title {
  font-size: 32px;
  color: #2c3e50;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.mpfi-subtitle {
  font-size: 16px;
  color: #7f8c8d;
  margin: 0 0 24px 0;
  font-weight: 400;
}

.mpfi-description {
  font-size: 16px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 30px;
}

.mpfi-info-boxes {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.mpfi-info-boxes .info-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  background: #f8fafc;
  border-radius: 10px;
  min-width: 100px;
}

.mpfi-info-boxes .info-box .fa {
  font-size: 24px;
  color: #3c8dbc;
  margin-bottom: 8px;
}

.mpfi-info-boxes .info-value {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
}

.mpfi-info-boxes .info-label {
  font-size: 13px;
  color: #7f8c8d;
  margin-top: 2px;
}

.mpfi-start-section {
  margin: 32px 0;
}

.btn-start {
  font-size: 18px;
  padding: 16px 40px;
  border-radius: 8px;
}

.mpfi-dimensions-preview {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 24px;
  margin-top: 32px;
  text-align: left;
}

.mpfi-dimensions-preview h4 {
  text-align: center;
  margin: 0 0 20px 0;
  color: #2c3e50;
}

.dimension-groups {
  display: flex;
  gap: 20px;
}

.dimension-group {
  flex: 1;
  padding: 16px;
  border-radius: 8px;
}

.dimension-flex {
  background: #e8f5e9;
  border-left: 4px solid #2E7D32;
}

.dimension-inflex {
  background: #ffebee;
  border-left: 4px solid #C62828;
}

.dimension-group h5 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}

.dimension-flex h5 {
  color: #2E7D32;
}

.dimension-inflex h5 {
  color: #C62828;
}

.dimension-group p {
  margin: 0;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .mpfi-welcome {
    padding: 20px 16px;
  }

  .mpfi-title {
    font-size: 24px;
  }

  .mpfi-info-boxes {
    gap: 12px;
  }

  .mpfi-info-boxes .info-box {
    padding: 12px 16px;
    min-width: 80px;
  }

  .mpfi-info-boxes .info-value {
    font-size: 22px;
  }

  .dimension-groups {
    flex-direction: column;
  }

  .btn-start {
    font-size: 16px;
    padding: 14px 32px;
    width: 100%;
  }
}

/* ==========================================================================
   Stats Boxes
   ========================================================================== */

.stats-section {
  margin-top: 30px;
}

.stat-box {
  background: white;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e8e8e8;
}

.stat-box h4 {
  font-size: 42px;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.stat-box p {
  margin: 0;
  color: #666;
  font-size: 13px;
  font-weight: 500;
}

.stat-box-blue h4 { color: #3c8dbc; }
.stat-box-green h4 { color: #00a65a; }
.stat-box-yellow h4 { color: #f39c12; }
.stat-box-red h4 { color: #dd4b39; }

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-danger { background-color: #dd4b39; }
.badge-info { background-color: #00c0ef; }
.badge-success { background-color: #00a65a; }
.badge-warning { background-color: #f39c12; }
.badge-default { background-color: #777; }
.badge-secondary { background-color: #6c757d; }
.badge-primary { background-color: #3c8dbc; }

/* ==========================================================================
   Landing Page
   ========================================================================== */

.landing-header {
  text-align: center;
  padding: 40px 20px 20px;
}

.landing-header h2 {
  margin-bottom: 10px;
}

.landing-header p {
  color: #666;
  font-size: 16px;
}

/* ==========================================================================
   Admin Styles
   ========================================================================== */

.admin-actions {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.admin-actions .btn {
  margin-right: 10px;
}

/* Table action buttons */
.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 3px;
  margin-right: 3px;
}

/* ==========================================================================
   Sidebar User Info
   ========================================================================== */

.user-sidebar-info {
  padding: 10px 0;
}

.user-sidebar-info p {
  margin: 5px 0;
}

.user-sidebar-info .label {
  padding: 4px 10px;
  border-radius: 4px;
  color: white;
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
   Instructions Section
   ========================================================================== */

.instructions {
  background-color: #e7f3ff;
  border-left: 4px solid #2196F3;
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
}

.instructions h4 {
  margin-top: 0;
  color: #1976D2;
}

/* ==========================================================================
   Item Display (Survey)
   ========================================================================== */

.item-text {
  background-color: #f9f9f9;
  padding: 15px;
  border-left: 4px solid #3c8dbc;
  margin: 10px 0;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.6;
}

/* ==========================================================================
   Radio Buttons
   ========================================================================== */

.radio {
  margin: 10px 0;
  padding: 10px;
}

.radio label {
  font-size: 15px;
  font-weight: normal;
  padding-left: 5px;
}

.radio input[type="radio"] {
  margin-right: 10px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

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

.btn-lg {
  font-size: 16px;
  padding: 12px 24px;
}

.btn-primary {
  background-color: #3c8dbc;
  border-color: #3c8dbc;
}

.btn-primary:hover {
  background-color: #357ca5;
  border-color: #357ca5;
}

.btn-success {
  background-color: #00a65a;
  border-color: #00a65a;
}

.btn-success:hover {
  background-color: #008d4c;
  border-color: #008d4c;
}

.btn-warning {
  background-color: #f39c12;
  border-color: #f39c12;
  color: white;
}

.btn-warning:hover {
  background-color: #e08e0b;
  border-color: #e08e0b;
  color: white;
}

.btn-danger {
  background-color: #dd4b39;
  border-color: #dd4b39;
}

.btn-danger:hover {
  background-color: #c9302c;
  border-color: #c9302c;
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.progress {
  height: 25px;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  background-color: #f5f5f5;
}

.progress-bar {
  font-size: 14px;
  line-height: 25px;
  font-weight: 600;
}

.progress-container {
  margin: 20px 0;
}

/* ==========================================================================
   Tables
   ========================================================================== */

table {
  width: 100%;
  margin-top: 10px;
}

table thead {
  background-color: #f5f5f5;
}

table th {
  font-weight: 600;
  color: #34495e;
  padding: 12px;
  text-align: left;
}

table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e3e3e3;
}

table tr:hover {
  background-color: #f9f9f9;
}

/* DataTables styling */
.dataTables_wrapper {
  padding: 15px 0;
}

.dataTables_filter input {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 12px;
}

/* ==========================================================================
   Score Boxes
   ========================================================================== */

.score-box {
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin: 10px 0;
}

.score-box h2 {
  margin: 0;
  font-size: 48px;
  font-weight: bold;
}

.score-box h4 {
  margin: 10px 0 0 0;
  font-size: 18px;
}

/* ==========================================================================
   File Input
   ========================================================================== */

.form-control-file {
  padding: 10px;
  border: 2px dashed #ccc;
  border-radius: 4px;
  background-color: #fafafa;
}

.form-control-file:hover {
  border-color: #3c8dbc;
  background-color: #f0f8ff;
}

/* ==========================================================================
   Alerts and Notifications
   ========================================================================== */

.alert {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.alert-danger {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
}

.alert-warning {
  background-color: #fffbe6;
  border: 1px solid #ffe58f;
  color: #ad6800;
}

.alert-info {
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #0050b3;
}

.alert-success {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #389e0d;
}

.shiny-notification {
  position: fixed;
  top: 60px;
  right: 20px;
  min-width: 300px;
  max-width: 400px;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 99999;
}

.shiny-notification-message {
  background-color: #52c41a;
  color: white;
}

.shiny-notification-warning {
  background-color: #faad14;
  color: white;
}

.shiny-notification-error {
  background-color: #f5222d;
  color: white;
}

/* ==========================================================================
   Info Lists
   ========================================================================== */

ul, ol {
  line-height: 1.8;
}

li {
  margin: 8px 0;
}

/* ==========================================================================
   Modal Dialogs
   ========================================================================== */

.modal-content {
  border-radius: 8px;
  border: none;
  box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.modal-header {
  background-color: #3c8dbc;
  color: white;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 15px 20px;
}

.modal-header .close {
  color: white;
  opacity: 0.8;
}

.modal-header .close:hover {
  opacity: 1;
}

.modal-title {
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.shiny-busy-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 20px 35px;
  border-radius: 8px;
  font-size: 16px;
  z-index: 99999;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 992px) {
  .test-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
  }
  
  .stat-box h4 {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .auth-container {
    padding: 30px 25px;
  }
  
  .auth-icon {
    font-size: 42px;
  }
  
  .btn-lg {
    font-size: 14px;
    padding: 10px 20px;
  }

  .item-text {
    font-size: 14px;
  }

  h2 {
    font-size: 24px;
  }
  
  .test-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .landing-header {
    padding: 20px 10px;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: 10px;
  }

  .auth-container {
    padding: 25px 20px;
  }

  .user-menu {
    padding: 5px 10px;
  }

  .user-info {
    display: none;
  }
}

/* ==========================================================================
   Survey Module - Best Practices for Psychological Likert Scales
   - Focused, distraction-free interface
   - No doomscrolling (contained view)
   - Responsive design (mobile-first)
   - Clear visual Likert scale with endpoint anchors
   - Touch-friendly controls
   ========================================================================== */

/* Survey Container - Full height layout */
.survey-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 100px);
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Fixed Header */
.survey-header {
  background: linear-gradient(135deg, #3c8dbc 0%, #2c6a91 100%);
  color: white;
  padding: 16px 24px;
  flex-shrink: 0;
}

.survey-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.survey-progress {
  flex: 1;
  min-width: 200px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  opacity: 0.95;
}

.progress-label {
  font-weight: 500;
}

.progress-numbers {
  font-weight: 600;
}

.progress-bar-container {
  background: rgba(255,255,255,0.25);
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  background: #fff;
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}

.subscale-indicator {
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

/* Main Content Area */
.survey-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
}

/* Participant Info */
.participant-info {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

.info-row {
  display: flex;
  gap: 20px;
}

.info-field {
  flex: 1;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
}

.participant-info-compact {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: #f1f5f9;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #64748b;
}

.info-compact-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Instructions */
.survey-instructions {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.instruction-main {
  font-size: 16px;
  color: #1e40af;
  margin: 0 0 16px 0;
  line-height: 1.6;
}

.scale-legend {
  display: flex;
  gap: 30px;
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid #bfdbfe;
}

.scale-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.scale-value {
  background: #3c8dbc;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.scale-desc {
  color: #64748b;
}

/* Questions Container */
.questions-container {
  margin-bottom: 20px;
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Single Question Item */
.question-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.question-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.question-item.unanswered {
  border-color: #fecaca;
  background: #fef2f2;
}

.question-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-item.unanswered .question-number {
  background: #fecaca;
  color: #b91c1c;
}

.question-content {
  flex: 1;
  min-width: 0;
}

.question-text {
  font-size: 15px;
  line-height: 1.6;
  color: #1e293b;
  margin: 0 0 16px 0;
}

/* Likert Scale */
.likert-scale {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.scale-anchor {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  padding: 4px 0;
  flex-shrink: 0;
  width: 70px;
  display: flex;
  align-items: center;
}

.anchor-left {
  justify-content: flex-start;
}

.anchor-right {
  justify-content: flex-end;
}

.scale-options {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

/* Likert Option Button */
.likert-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 60px;
  text-align: center;
}

.likert-option:hover {
  border-color: #3c8dbc;
  background: #f0f9ff;
}

.likert-option.selected {
  background: #3c8dbc;
  border-color: #3c8dbc;
  color: white;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(60, 141, 188, 0.3);
}

.likert-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.likert-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.likert-label {
  font-size: 10px;
  margin-top: 4px;
  line-height: 1.2;
  opacity: 0.85;
}

.likert-option.selected .likert-label {
  opacity: 1;
}

/* Fixed Footer */
.survey-footer {
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 16px 24px;
  flex-shrink: 0;
}

.survey-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.btn-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s;
  min-width: 120px;
  justify-content: center;
}

.btn-prev {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.btn-prev:hover {
  background: #e2e8f0;
}

.btn-next {
  background: #3c8dbc;
  border: 1px solid #3c8dbc;
  color: white;
}

.btn-next:hover {
  background: #2c6a91;
  border-color: #2c6a91;
}

.page-indicator {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

/* Submit Container */
.submit-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.btn-submit {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Completion Modal */
.completion-modal {
  text-align: center;
  padding: 10px 0;
}

.completion-modal p {
  font-size: 15px;
  margin: 12px 0;
}

.filename-info {
  background: #f1f5f9;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  color: #64748b;
}

/* ==========================================================================
   Survey Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .survey-container {
    min-height: calc(100vh - 60px);
    border-radius: 0;
    box-shadow: none;
  }

  .survey-header {
    padding: 12px 16px;
  }

  .survey-header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .subscale-indicator {
    text-align: center;
    padding: 6px 12px;
    font-size: 13px;
  }

  .survey-content {
    padding: 16px;
  }

  .info-row {
    flex-direction: column;
    gap: 12px;
  }

  .participant-info-compact {
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
  }

  .scale-legend {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .question-item {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .question-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .question-text {
    font-size: 14px;
    margin-bottom: 12px;
  }

  /* Vertical Likert scale on mobile */
  .likert-scale {
    flex-direction: column;
    gap: 4px;
  }

  .scale-anchor {
    display: none; /* Hide anchors on mobile, labels visible in buttons */
  }

  .scale-options {
    flex-direction: column;
    gap: 8px;
  }

  .likert-option {
    flex-direction: row;
    justify-content: flex-start;
    padding: 14px 16px;
    gap: 12px;
    min-height: auto;
  }

  .likert-value {
    font-size: 16px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .likert-option.selected .likert-value {
    background: rgba(255,255,255,0.2);
  }

  .likert-label {
    font-size: 13px;
    margin: 0;
    text-align: left;
  }

  .survey-footer {
    padding: 12px 16px;
  }

  .btn-nav {
    padding: 10px 16px;
    font-size: 14px;
    min-width: 100px;
  }

  .nav-text {
    display: none;
  }

  .page-indicator {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .survey-header {
    padding: 10px 12px;
  }

  .survey-content {
    padding: 12px;
  }

  .question-item {
    padding: 12px;
  }

  .question-text {
    font-size: 13px;
  }

  .likert-option {
    padding: 12px;
  }

  .likert-label {
    font-size: 12px;
  }

  .btn-nav {
    padding: 10px 12px;
    min-width: 80px;
  }
}

/* Touch-friendly enhancements */
@media (pointer: coarse) {
  .likert-option {
    min-height: 48px;
  }

  .btn-nav {
    min-height: 48px;
  }
}

/* ==========================================================================
   FOCUS MODE - Full Screen Survey (No Distractions)
   Designed to fit 5 questions on 1920x1080 without scrolling
   ========================================================================== */

.focus-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f8fafc;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

/* Focus Mode Survey Container - fills viewport */
.focus-mode .survey-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  width: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 100vh;
  background: #fff;
}

/* Compact Header */
.focus-mode .survey-header {
  padding: 8px 20px;
  background: #2c3e50;
  flex-shrink: 0;
}

.focus-mode .survey-header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Exit Button */
.focus-mode .btn-exit {
  background: rgba(255,255,255,0.15);
  border: none;
  color: rgba(255,255,255,0.9);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.focus-mode .btn-exit:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Progress Bar in Focus Mode */
.focus-mode .survey-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.focus-mode .progress-bar-container {
  flex: 1;
  height: 6px;
  max-width: 400px;
}

.focus-mode .progress-text {
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
  opacity: 0.9;
}

/* Subscale Indicator in Focus Mode */
.focus-mode .subscale-indicator {
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

/* Main Content - No scroll needed */
.focus-mode .survey-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 24px;
  overflow: hidden;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.focus-mode .questions-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* Questions List - Compact rows */
.focus-mode .questions-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Compact Question Row */
.focus-mode .q-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: border-color 0.2s;
}

.focus-mode .q-row:hover {
  border-color: #cbd5e1;
}

.focus-mode .q-row.unanswered {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* Question Number - Small circle */
.focus-mode .q-num {
  width: 28px;
  height: 28px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.focus-mode .q-row.unanswered .q-num {
  background: #fca5a5;
  color: #991b1b;
}

/* Question Text - Fills available space */
.focus-mode .q-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #1e293b;
  min-width: 0;
}

/* Likert Scale - Horizontal compact buttons */
.focus-mode .q-scale {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Labeled Likert Button */
.focus-mode .likert-btn {
  padding: 8px 12px;
  min-width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.focus-mode .likert-btn:hover {
  border-color: #3c8dbc;
  background: #eff6ff;
}

/* Selected state - using :has() for modern browsers */
.focus-mode .likert-btn:has(input:checked) {
  background: #3c8dbc;
  border-color: #3c8dbc;
  color: #fff;
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(60, 141, 188, 0.3);
}

/* Fallback for older browsers / R-generated class */
.focus-mode .likert-btn.selected {
  background: #3c8dbc;
  border-color: #3c8dbc;
  color: #fff;
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(60, 141, 188, 0.3);
}

.focus-mode .likert-btn input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.focus-mode .likert-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
  white-space: nowrap;
}

/* Compact Footer */
.focus-mode .survey-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.focus-mode .btn-nav {
  padding: 10px 20px;
  font-size: 14px;
  min-width: 100px;
}

.focus-mode .page-indicator {
  font-size: 13px;
  color: #64748b;
  min-width: 100px;
  text-align: center;
}

.focus-mode .btn-submit {
  padding: 10px 24px;
  font-size: 14px;
  margin-left: 12px;
}

/* ==========================================================================
   Focus Mode Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .focus-mode .survey-content {
    padding: 10px 16px;
  }

  .focus-mode .q-text {
    font-size: 13px;
  }

  .focus-mode .likert-btn {
    padding: 6px 8px;
    min-width: 60px;
  }

  .focus-mode .likert-label {
    font-size: 11px;
  }
}

@media (max-width: 900px) {
  .focus-mode .survey-header {
    padding: 8px 12px;
  }

  .focus-mode .survey-content {
    padding: 8px 12px;
    overflow-y: auto;
  }

  .focus-mode .q-row {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }

  .focus-mode .q-num {
    position: absolute;
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .focus-mode .q-text {
    font-size: 13px;
    padding-left: 32px;
  }

  .focus-mode .q-scale {
    display: flex;
    justify-content: space-between;
    gap: 4px;
  }

  .focus-mode .likert-btn {
    flex: 1;
    padding: 10px 4px;
    min-width: 0;
  }

  .focus-mode .likert-label {
    font-size: 10px;
  }
}

/* Mobile - vertical labels */
@media (max-width: 600px) {
  .focus-mode .likert-label {
    font-size: 9px;
  }

  .focus-mode .q-row {
    position: relative;
  }
}
