/* StretchStrong Authentication - Aligned with Main Site */

:root {
  /* Matching main site colors exactly */
  --primary-color: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent-color: #10b981;
  --accent-light: #34d399;
  
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  
  /* Shadows matching main site */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.dashboard-active {
  display: block;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

/* Auth Container - Clean white background like main site */
.auth-container {
  width: 100%;
  max-width: 450px;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

/* Auth Forms */
.auth-form {
  display: none;
  padding: 40px;
}

.auth-form.active {
  display: block;
}

/* Header matching main site style */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 24px;
}

.logo i {
  font-size: 28px;
}

.auth-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Form styling matching main site */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

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

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 16px;
  z-index: 1;
}

.input-group input,
.input-group select,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all 0.2s ease;
  font-family: inherit;
}

.input-group input,
.input-group select {
  padding-left: 40px;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-group input[readonly] {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.form-group small {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.input-group input:focus,
.input-group select:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  z-index: 1;
}

/* Activity Level Selector */
.level-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.level-card:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.level-card i {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.level-card span {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.level-card small {
  font-size: 12px;
  color: var(--text-secondary);
}

input[type="radio"]:checked + .level-card {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="radio"] {
  display: none;
}

/* Buttons matching main site */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--border-medium);
}

.full-width {
  width: 100%;
}

/* Checkbox styling */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.checkbox input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.checkbox input:checked + .checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox input:checked + .checkmark:after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Form options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
}

.forgot-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-divider:before,
.auth-divider:after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-divider span {
  padding: 0 16px;
}

/* Social auth buttons */
.social-auth {
  display: flex;
  gap: 12px;
}

.btn-google,
.btn-apple {
  flex: 1;
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-google:hover,
.btn-apple:hover {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
}

/* Auth switch */
.auth-switch {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-switch a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Password requirements */
.password-requirements {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.requirement {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.requirement.valid {
  color: var(--accent-color);
}

.requirement:before {
  content: '○';
  margin-right: 6px;
  font-size: 8px;
}

.requirement.valid:before {
  content: '●';
  color: var(--accent-color);
}

/* Message styling */
.auth-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: none;
  max-width: 400px;
  z-index: 1000;
}

.auth-message.show {
  display: block;
}

.auth-message.success {
  border-color: var(--accent-color);
  background: rgba(16, 185, 129, 0.05);
}

.auth-message.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.message-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.success-icon {
  color: var(--accent-color);
}

.error-icon {
  color: #ef4444;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner i {
  font-size: 32px;
  color: var(--primary-color);
}

.loading-spinner p {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Dashboard styles */
.dashboard-container {
  width: 100%;
  min-height: 100vh;
  background: var(--bg-secondary);
}

.dashboard-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--primary-color);
  background: var(--bg-secondary);
}

.nav-btn.active {
  color: var(--primary-color);
  background: var(--bg-secondary);
}

/* User menu */
.user-menu {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-info:hover {
  background: var(--bg-secondary);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.user-plan {
  font-size: 12px;
  color: var(--text-secondary);
}

.dropdown-arrow {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.user-info.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  display: none;
  z-index: 100;
}

.user-dropdown.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg-secondary);
}

.dropdown-item.logout {
  color: #ef4444;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

/* Dashboard main content */
.dashboard-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.dashboard-section {
  display: none;
}

.dashboard-section.active {
  display: block;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.stat-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-trend {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-trend.positive {
  color: var(--accent-color);
}

/* Dashboard cards */
.dashboard-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 32px;
}

.card-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-outline {
  background: none;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Profile grid */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 32px;
}

.profile-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 32px;
}

.profile-card h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* Switch styling */
.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-medium);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Responsive design */
@media (max-width: 768px) {
  .auth-container {
    margin: 20px;
    max-width: none;
  }
  
  .auth-form {
    padding: 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .level-selector {
    grid-template-columns: 1fr;
  }
  
  .social-auth {
    flex-direction: column;
  }
  
  .dashboard-main {
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-grid {
    grid-template-columns: 1fr;
  }
  
  .header-container {
    flex-direction: column;
    gap: 16px;
  }
  
  .main-nav {
    overflow-x: auto;
    padding: 0 0 8px;
  }
}

/* New Dashboard Section Styles */

/* Protocols Section */
.protocols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 24px;
}

.protocol-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s ease;
}

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

.protocol-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  margin: 0 auto 16px;
}

.protocol-card h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.protocol-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.protocol-progress {
  margin-bottom: 16px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transition: width 0.3s ease;
}

.protocol-progress span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Assessment Section */
.assessment-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  padding: 24px;
}

.assessment-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 24px;
  border-left: 4px solid;
}

.assessment-card.low-risk {
  border-left-color: var(--accent-color);
}

.assessment-card.medium-risk {
  border-left-color: #f59e0b;
}

.assessment-card.high-risk {
  border-left-color: #ef4444;
}

.risk-indicator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.risk-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.low-risk .risk-circle {
  background: var(--accent-color);
}

.medium-risk .risk-circle {
  background: #f59e0b;
}

.high-risk .risk-circle {
  background: #ef4444;
}

.risk-indicator h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.risk-status {
  font-size: 14px;
  font-weight: 500;
}

.low-risk .risk-status {
  color: var(--accent-color);
}

.medium-risk .risk-status {
  color: #f59e0b;
}

.high-risk .risk-status {
  color: #ef4444;
}

.recommendations h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.recommendations ul {
  list-style: none;
  padding: 0;
}

.recommendations li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  position: relative;
  padding-left: 16px;
}

.recommendations li:before {
  content: '•';
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Progress Section */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 24px;
}

.chart-placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-medium);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

.chart-placeholder i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.chart-placeholder h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.chart-placeholder p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Goals Section */
.goals-grid {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.goal-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid;
}

.goal-card.in-progress {
  border-left-color: var(--primary-color);
}

.goal-card.completed {
  border-left-color: var(--accent-color);
}

.goal-card.upcoming {
  border-left-color: var(--text-muted);
}

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

.goal-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.goal-status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.in-progress .goal-status {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
}

.completed .goal-status {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-color);
}

.upcoming .goal-status {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.goal-progress {
  margin-bottom: 12px;
}

.goal-progress .progress-bar {
  height: 6px;
  margin-bottom: 6px;
}

.goal-progress span {
  font-size: 12px;
  color: var(--text-secondary);
}

.goal-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== Activity Feed ===== */
.active-protocols,
.activity-feed {
  padding: 24px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.activity-icon.exercise {
  background: var(--primary-color);
}

.activity-icon.achievement {
  background: #f59e0b;
}

.activity-icon.assessment {
  background: var(--accent-color);
}

.activity-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.activity-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.activity-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.activity-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-duration {
  font-size: 11px;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* ===== Empty States ===== */
.empty-state,
.error-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-state i,
.error-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.empty-state h4,
.error-state h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p,
.error-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* ===== Protocol Cards in Overview ===== */
.active-protocols .protocol-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin-bottom: 12px;
  text-align: left;
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.active-protocols .protocol-card:last-child {
  margin-bottom: 0;
}

.active-protocols .protocol-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.active-protocols .protocol-info {
  flex: 1;
}

.active-protocols .protocol-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.active-protocols .protocol-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.active-protocols .protocol-stats {
  display: flex;
  gap: 20px;
}

.active-protocols .protocol-stats .stat {
  text-align: center;
}

.active-protocols .protocol-stats .stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.active-protocols .protocol-stats .stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.active-protocols .protocol-actions {
  display: flex;
  gap: 8px;
}

.active-protocols .protocol-icon {
  margin: 0;
}

.progress-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary-color) calc(var(--progress, 0) * 3.6deg),
    var(--bg-tertiary) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.progress-circle::before {
  content: '';
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  position: absolute;
}

.progress-circle span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== Protocol Meta (library grid) ===== */
.protocol-meta {
  display: flex;
  gap: 16px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.meta-item i {
  color: var(--primary-color);
  font-size: 14px;
}

.risk-reduction {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.06);
  border-radius: 8px;
  margin-top: 12px;
}

.reduction-percentage {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
}

.reduction-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.premium-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.protocol-card.premium {
  position: relative;
  border-color: rgba(245, 158, 11, 0.3);
}

/* ===== Filter Tabs ===== */
.protocols-filter {
  margin-bottom: 24px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 20px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-tab.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===== Achievement Cards ===== */
.achievements-section {
  margin-top: 32px;
}

.achievements-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.achievement-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  opacity: 0.5;
  transition: all 0.2s ease;
}

.achievement-card.earned {
  opacity: 1;
  border-color: #f59e0b;
}

.achievement-card i {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}

.achievement-card.earned i {
  color: #f59e0b;
}

.achievement-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.achievement-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.achievement-progress {
  margin-top: 12px;
}

.achievement-progress span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Progress Overview ===== */
.progress-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.progress-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

.progress-card .card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.progress-card .card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.chart-container {
  padding: 24px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Assessment Section Enhanced ===== */
.assessment-container {
  max-width: 700px;
  margin: 0 auto;
}

.assessment-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

.assessment-header {
  padding: 32px 32px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.step-indicator .step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.step-indicator .step.active {
  background: var(--primary-color);
  color: white;
}

.assessment-content {
  padding: 32px;
}

.question-group {
  margin-bottom: 32px;
}

.question-group > label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.sport-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sport-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.sport-card:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.sport-card i {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.sport-card span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

input[type="radio"]:checked + .sport-card {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.frequency-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.frequency-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.frequency-card:hover {
  border-color: var(--primary-color);
}

.freq-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.frequency-card small {
  font-size: 12px;
  color: var(--text-secondary);
}

input[type="radio"]:checked + .frequency-card {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.assessment-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* ===== Protocol Cards (Library Grid) ===== */
.protocols-grid .protocol-card {
  text-align: left;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

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

.protocol-card-top .protocol-icon {
  width: 48px;
  height: 48px;
  font-size: 18px;
  margin: 0;
}

.protocol-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.region-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.evidence-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.08);
  color: #8b5cf6;
}

.protocol-card .protocol-injury {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
  flex: 1;
}

.protocol-evidence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 0;
  margin-bottom: 12px;
  border-top: 1px solid var(--border-light);
}

.protocol-evidence-bar i {
  color: #8b5cf6;
}

/* Type filter tabs */
.type-tab {
  padding: 6px 16px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-tab:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.type-tab.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===== Protocol Modal (Detail View) ===== */
.protocol-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  z-index: 1000;
  overflow-y: auto;
}

.protocol-modal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.protocol-modal-header {
  margin-bottom: 24px;
}

.modal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
}

.modal-back:hover {
  text-decoration: underline;
}

.protocol-detail-header {
  margin-bottom: 24px;
}

.protocol-detail-title {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.protocol-icon.large {
  width: 64px;
  height: 64px;
  font-size: 24px;
  flex-shrink: 0;
}

.protocol-detail-title h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.protocol-injury-detail {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.protocol-detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.protocol-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.protocol-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.detail-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 18px;
}

.detail-stat i {
  font-size: 20px;
  color: var(--primary-color);
  width: 24px;
  text-align: center;
}

.detail-stat strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-stat span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Phase Blocks ===== */
.protocol-phases-detail {
  margin-bottom: 40px;
}

.phase-block {
  margin-bottom: 32px;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.phase-number {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.phase-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.phase-duration {
  font-size: 13px;
  color: var(--text-muted);
}

.phase-duration i {
  margin-right: 4px;
}

/* ===== Exercise Cards ===== */
.exercises-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  border-left: 2px solid var(--border-light);
  margin-left: 19px;
}

.exercise-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.exercise-card:hover {
  box-shadow: var(--shadow-sm);
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  user-select: none;
}

.exercise-number {
  width: 28px;
  height: 28px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.exercise-summary {
  flex: 1;
}

.exercise-summary h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.exercise-prescription {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 500;
}

.exercise-toggle {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.exercise-toggle.open {
  transform: rotate(180deg);
}

.exercise-detail {
  padding: 0 16px 16px 58px;
}

.exercise-detail p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ===== Protocol Footer Info ===== */
.protocol-footer-info {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.info-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
}

.info-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-section h3 i {
  color: var(--primary-color);
}

.info-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.info-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-section li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0 6px 20px;
  position: relative;
}

.info-section li::before {
  content: '•';
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.protocol-prevalence {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.protocol-prevalence i {
  color: var(--primary-color);
  font-size: 16px;
}

/* ===== Mobile responsive additions ===== */
@media (max-width: 768px) {
  .active-protocols .protocol-card {
    flex-direction: column;
    text-align: center;
  }

  .active-protocols .protocol-header {
    flex-direction: column;
  }

  .active-protocols .protocol-actions {
    width: 100%;
    justify-content: center;
  }

  .activity-content {
    flex-direction: column;
  }

  .activity-meta {
    flex-direction: row;
    align-items: center;
  }

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

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

  .progress-overview {
    grid-template-columns: 1fr;
  }

  .assessment-content {
    padding: 20px;
  }

  .nav-btn span {
    display: none;
  }

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

  .user-details {
    display: none;
  }

  .dropdown-arrow {
    display: none;
  }
}