/* Share Workout Modal Styles */

.share-workout-modal {
  /* Base modal styles inherited from .modal class */
}

.share-workout-modal .modal-content {
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.share-workout-modal .modal-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Workout List Container */
.workout-list-container {
  flex: 1;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  margin-bottom: 1rem;
}

.workout-list {
  padding: 0.5rem;
}

/* Workout Item Styles */
.workout-item {
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-primary);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.workout-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

.workout-item.selected {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.workout-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.workout-item-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.workout-item-stats {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.5rem;
}

.workout-item-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* No Programs Message */
.no-programs-message,
.error-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.no-programs-message p:first-child,
.error-message p:first-child {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* Workout Preview */
.workout-preview-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  max-height: 250px;
  overflow-y: auto;
}

.workout-preview-container h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.workout-preview-content h4 {
  margin: 0 0 0.75rem 0;
  color: var(--accent-primary);
  font-size: 1.1rem;
}

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

.preview-day {
  background: var(--bg-primary);
  padding: 0.75rem;
  border-radius: 6px;
}

.preview-day h5 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.preview-exercises {
  list-style: none;
  padding: 0;
  margin: 0;
}

.preview-exercises li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-exercises .more-exercises {
  font-style: italic;
  color: var(--text-muted);
}

.preview-more {
  text-align: center;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Sanitize Toggle */
.sanitize-toggle-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type='checkbox'] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 48px;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 24px;
  transition: background-color 0.3s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-slider {
  background: var(--accent-primary);
}

.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(24px);
}

.toggle-text {
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-description {
  margin: 0.5rem 0 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Modal Footer Buttons */
.share-workout-modal .modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.share-workout-modal .btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-workout-modal .btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.share-workout-modal .btn-secondary:hover {
  background: var(--bg-tertiary);
}

.share-workout-modal .btn-primary {
  background: var(--accent-primary);
  color: white;
}

.share-workout-modal .btn-primary:hover:not(:disabled) {
  background: var(--accent-secondary);
}

.share-workout-modal .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
  .share-workout-modal .modal-content {
    max-width: 95vw;
    margin: 1rem;
  }

  .workout-list-container {
    max-height: 200px;
  }

  .preview-days {
    grid-template-columns: 1fr;
  }

  .workout-preview-container {
    max-height: 200px;
  }

  .share-workout-modal .modal-footer {
    flex-direction: column;
  }

  .share-workout-modal .btn {
    width: 100%;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .workout-item {
    background: var(--bg-card);
  }

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

  .preview-day {
    background: var(--bg-card);
  }
}

/* Animations */
.share-workout-modal.modal-open .workout-item {
  animation: slideInUp 0.3s ease forwards;
  opacity: 0;
}

.share-workout-modal.modal-open .workout-item:nth-child(1) {
  animation-delay: 0.05s;
}
.share-workout-modal.modal-open .workout-item:nth-child(2) {
  animation-delay: 0.1s;
}
.share-workout-modal.modal-open .workout-item:nth-child(3) {
  animation-delay: 0.15s;
}
.share-workout-modal.modal-open .workout-item:nth-child(4) {
  animation-delay: 0.2s;
}
.share-workout-modal.modal-open .workout-item:nth-child(5) {
  animation-delay: 0.25s;
}

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