:root {
  --primary: #4F46E5;
  --primary-dark: #4338ca;
  --primary-light: #EEF2FF;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px; /* Space for bottom nav */
}

/* App Container - simulates mobile width on desktop but fluid */
.app-container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  min-height: 100vh;
  position: relative;
  box-shadow: var(--shadow-lg);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: white;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--gray-900);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Main Content */
.main-content {
  padding: 20px;
}

/* Typography */
h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
p { margin-top: 0; color: var(--gray-600); }

/* Cards */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.card-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 0.875rem;
  color: var(--gray-400);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  width: 100%; /* Mobile first: full width buttons often */
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: #D1FAE5; color: #059669; }
.badge-yellow { background: #FEF3C7; color: #D97706; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--gray-700);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  ring: 2px solid var(--primary-light);
}

/* Likert Scale Specifics */
.likert-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.likert-option {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: white;
}

.likert-option:hover {
  background-color: var(--gray-50);
  border-color: var(--gray-400);
}

.likert-option.selected {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.likert-radio {
  margin-right: 16px;
  width: 24px;
  height: 24px;
  accent-color: var(--primary);
}

.likert-label {
  font-weight: 500;
  flex: 1;
}

/* Role Switcher for Prototype */
.role-badge {
  background: var(--gray-800);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 8px;
}

/* Timeline / Steps */
.step-list {
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
}

.step-list::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 16px;
  width: 2px;
  background: var(--gray-200);
  z-index: 0;
}

.step-item {
  position: relative;
  padding-left: 48px;
  padding-bottom: 32px;
  z-index: 1;
}

.step-item:last-child {
  padding-bottom: 0;
}

.step-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-400);
}

.step-item.active .step-marker {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.step-item.completed .step-marker {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-content h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
}

.step-content p {
  font-size: 0.875rem;
  margin: 0;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 12px;
  display: flex;
  justify-content: space-around;
  z-index: 100;
  max-width: 600px; /* match app container */
  margin: 0 auto; /* center it */
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--gray-400);
  font-size: 0.75rem;
  gap: 4px;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  width: 24px;
  height: 24px;
  background-color: currentColor;
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

/* Icon Placeholders using masks */
.icon-home { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6' /%3E%3C/svg%3E"); }
.icon-calendar { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z' /%3E%3C/svg%3E"); }
.icon-user { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z' /%3E%3C/svg%3E"); }

/* Chat/Feedback bubbles */
.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 85%;
  margin-bottom: 12px;
  position: relative;
}

.chat-bubble.mine {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
  background: var(--gray-100);
  color: var(--gray-900);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.bubble-meta {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-top: 4px;
  display: block;
}

/* File Attachment */
.attachment {
  display: flex;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  margin-top: 8px;
}

.attachment-icon {
  width: 32px;
  height: 32px;
  background: var(--gray-200);
  border-radius: 4px;
  margin-right: 12px;
}

.attachment-info {
  flex: 1;
}

.attachment-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.attachment-size {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Helper for result */
.result-card {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.result-score {
  font-size: 3rem;
  font-weight: 800;
  margin: 16px 0;
}

/* Supervisor Mode Overrides */
.app-header.supervisor-mode {
  background: var(--gray-900);
  border-bottom: none;
  color: white;
}

.app-header.supervisor-mode .header-title {
  color: white;
}

.btn.supervisor-mode {
  background: var(--primary-dark);
}

