:root {
  /* Custom CSS Variables for Future Whitelabeling */
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 3rem;
  
  /* Borders */
  --border-radius: 0.375rem;
  --border-radius-lg: 0.5rem;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Custom Avatar Placeholder */
.avatar-placeholder {
  width: 40px;
  height: 40px;
  background: var(--bs-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* Note Type Icons */
.note-type-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Phase Section Styling */
.phase-section {
  position: relative;
}

.phase-section::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--bs-primary);
  border-radius: 2px;
}

/* Activity Cards */
.activity-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

/* Progress Indicators */
.progress-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: conic-gradient(var(--bs-primary) var(--progress, 0%), var(--bs-light) 0%);
}

.progress-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--bs-body-bg);
}

.progress-circle .progress-text {
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Custom Form Enhancements */
.form-floating-custom {
  position: relative;
}

.form-floating-custom .form-control {
  padding-top: 1.625rem;
  padding-bottom: 0.625rem;
}

.form-floating-custom .form-label {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding: 1rem 0.75rem;
  pointer-events: none;
  border: 1px solid transparent;
  transform-origin: 0 0;
  transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
  opacity: 0.65;
}

/* Rating Badges */
.rating-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Workout Exercise Tables */
.exercise-table {
  font-size: 0.875rem;
}

.exercise-table th {
  font-weight: 500;
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.5rem 0.25rem;
}

.exercise-table td {
  padding: 0.5rem 0.25rem;
  vertical-align: top;
}

/* Timeline Components */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bs-border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.25rem;
  top: 0.25rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bs-primary);
  border: 2px solid var(--bs-body-bg);
}

/* Statistics Cards */
.stat-card {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-rgb) 100%);
  color: white;
  border: none;
}

.stat-card .card-body {
  padding: 1.5rem;
}

.stat-card .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .btn-group .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .avatar-placeholder {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--bs-primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Custom Alerts */
.alert-custom {
  border: none;
  border-left: 4px solid;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.alert-custom.alert-primary {
  border-left-color: var(--bs-primary);
  background-color: rgba(13, 110, 253, 0.1);
}

.alert-custom.alert-success {
  border-left-color: var(--bs-success);
  background-color: rgba(25, 135, 84, 0.1);
}

.alert-custom.alert-warning {
  border-left-color: var(--bs-warning);
  background-color: rgba(255, 193, 7, 0.1);
}

.alert-custom.alert-danger {
  border-left-color: var(--bs-danger);
  background-color: rgba(220, 53, 69, 0.1);
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .alert,
  footer {
    display: none !important;
  }
  
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
  
  .card {
    border: 1px solid #dee2e6 !important;
    box-shadow: none !important;
  }
}

/* Accessibility Enhancements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .btn-outline-primary,
  .btn-outline-secondary {
    border-width: 2px;
  }
  
  .card {
    border-width: 2px;
  }
}

/* Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
