/* Dark Theme Workout Details Page */
:root {
  /* Color tokens */
  --color-primary: #FFFFFF;    /* Primary text color - white */
  --color-secondary: #D1D1D6;  /* Secondary text color */
  --color-tertiary: #8E8E93;   /* Tertiary text color */
  --color-accent: #66C997;     /* Accent color - brand green */

  /* Font size tokens */
  --font-size-xs: 12px;       /* Extra small - captions, labels */
  --font-size-sm: 14px;       /* Small - body text, details */
  --font-size-base: 16px;     /* Base - default text size */
  --font-size-lg: 20px;       /* Large - subheadings, descriptions */
  --font-size-xl: 24px;       /* Extra large - section headers */
  --font-size-2xl: 32px;      /* 2X large - major headers */
  --font-size-3xl: 48px;      /* 3X large - page titles */
  --font-size-4xl: 84px;      /* 4X large - hero titles */
  --font-size-5xl: 100px;     /* 5X large - display text */
}

.workout-details-container {
  background-color: #2b312c;
  min-height: 100vh;
  color: var(--color-primary);
  padding: 110px 15px 40px 15px; /* top right bottom left - consistent across all breakpoints */
}

/* Back Navigation */
.back-navigation {
  margin-bottom: 20px;
}

.back-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--font-size-base);
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-link:hover {
  color: var(--color-accent);
}

.back-link i {
  font-size: var(--font-size-base);
}

/* Main Layout - Now using grid.css classes */

/* Left Panel - Workout Image and Actions */
.workout-left-panel {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.workout-image-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.workout-image {
  width: 100% !important;
  height: 0 !important;
  padding-bottom: 100% !important; /* Creates a square aspect ratio */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 1 / 1 !important; /* Modern CSS fallback for square aspect ratio */
}

.workout-image-fallback {
  background: #212621;
}

.workout-image-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.workout-logo-fallback {
  width: 60%;
  height: 60%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.workout-icon {
  font-size: var(--font-size-5xl);
  margin-bottom: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: -20px;
}

.workout-label {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: white;
  letter-spacing: 1px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 40px;
}

/* Action Buttons */
.workout-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-block: 20px;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background-color: transparent;
  border: none;
  border-radius: 12px;
  color: var(--color-primary);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.action-button:hover {
  color: var(--color-accent);
  transform: translateY(-2px);
}

.action-button.share {
  color: var(--color-primary);
}

.action-button.share:hover {
  color: var(--color-accent);
}

.action-button i {
  font-size: var(--font-size-lg);
  width: 24px;
  text-align: center;
  transition: all 0.2s ease;
}

/* Workout Description */
.description-header {
  color: var(--color-secondary);
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: 15px;
  font-family: 'Exo 2', sans-serif;
}

.workout-description {
  color: var(--color-secondary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Right Panel - Workout Details */
.workout-right-panel {
  padding: 20px 0;
}

.creator-info {
  color: var(--color-secondary);
  font-size: var(--font-size-2xl);
  font-family: 'Exo 2', sans-serif;
}

.workout-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 10px;
  line-height: 1;
  font-family: 'Exo 2', sans-serif;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: transparent;
  border: 2px solid var(--color-accent);
  border-radius: 8px;
  color: var(--color-accent);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 20px;
}

.favorite-button:hover {
  background-color: var(--color-accent);
  color: #2b312c;
}

.favorite-button[data-is-favorite="true"] {
  background-color: var(--color-accent);
  color: #2b312c;
}

.favorite-button[data-is-favorite="true"]:hover {
  background-color: transparent;
  color: var(--color-accent);
}

.favorite-icon {
  font-size: var(--font-size-base);
  transition: all 0.3s ease;
}

.favorite-icon.favorited {
  color: #ef4444; /* Red color for favorited heart */
}

.favorite-icon.not-favorited {
  color: transparent;
  -webkit-text-stroke: 1px white;
}

.workout-summary {
  color: var(--color-secondary);
  font-size: var(--font-size-base);
  margin-bottom: 20px;
}

/* Exercise List */
/* Expand/Collapse All Icons */
.expand-collapse-all-icons {
  display: none; /* Hidden by default, shown via JavaScript when notes exist */
  justify-content: flex-end;
  margin: 15px 0;
  cursor: pointer;
}

.icon-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-stack:hover {
  background-color: rgba(102, 201, 151, 0.1);
  transform: scale(1.1);
}

.expand-collapse-all-icons i {
  color: var(--color-primary);
  font-size: var(--font-size-base);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-block: -2px;
}

.expand-collapse-all-icons:hover i {
  color: var(--color-accent);
}

.expand-collapse-all-icons.collapse-all .icon-stack {
  flex-direction: column-reverse;
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.exercise-item {
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.exercise-bar {
  width: 40px;
  height: 40px;
  background-color: var(--color-accent);
  border-radius: 4px;
  flex-shrink: 0; /* Don't shrink */
}

.exercise-name {
  color: var(--color-primary);
  font-size: var(--font-size-base);
  font-weight: 500;
  flex: 1; /* Take remaining space */
}

.exercise-link {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.exercise-link:hover {
  color: var(--color-accent);
}

.exercise-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
}

.exercise-details {
  color: var(--color-secondary);
  font-size: var(--font-size-base);
  text-align: center;
  flex-shrink: 0; /* Don't shrink */
}

.exercise-time {
  color: var(--color-secondary);
  font-size: var(--font-size-base);
  text-align: right;
  min-width: 80px;
  flex-shrink: 0; /* Don't shrink */
}

/* List Divider */
.list-divider {
  border: none;
  height: 1px;
  background-color: var(--color-tertiary);
  opacity: 0.3;
}

/* Segment Divider */
.segment-divider {
  border: none;
  height: 1px;
  background-color: var(--color-tertiary);
  opacity: 0.3;
}

/* Segment Type Headers */
.segment-type-header {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-secondary);
  font-family: 'Exo 2', sans-serif;
}

/* Segment Header Row - for Circuit/Superset with notes */
.segment-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Notes Indicators - for both segment headers and single exercises */
.segment-notes-indicator {
  color: var(--color-primary);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Smooth icon rotation */
  transform-origin: center;
}

.segment-notes-indicator:hover {
  transform: translateY(2px) scale(1.05);
  color: var(--color-accent);
}

/* Expanded state styling with smooth transitions */
.segment-notes-indicator.expanded {
  transform: translateY(0) scale(1.1);
  /* Enhanced glow effect when expanded */
  text-shadow: 0 0 12px var(--color-accent), 0 0 20px rgba(102, 201, 151, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth icon rotation animation */
.segment-notes-indicator i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.segment-notes-indicator.expanded i {
  transform: rotate(180deg);
}

/* Prevent rapid clicks */
.segment-notes-indicator.clicked {
  pointer-events: none;
  opacity: 0.7;
}

/* Notes Display */
.segment-notes-display {
  background-color: rgba(102, 201, 151, 0.1);
  border-left: 1px solid var(--color-accent);
  /* Hidden by default with smooth animations */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-20px);
  position: relative;
  z-index: 1;
  /* Smooth transitions for all properties */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* Ensure smooth height animation */
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
}

/* Show state with smooth expansion */
.segment-notes-display.show {
  max-height: 500px; /* Large enough to accommodate any content */
  opacity: 1;
  transform: translateY(0);
  padding: 10px 20px 15px;
  margin-block: 10px;
}

.notes-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  /* Smooth entrance animation for content */
  animation: fadeInContent 0.5s ease-out 0.2s both;
}

/* Content fade-in animation */
@keyframes fadeInContent {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notes-header {
  color: var(--color-secondary);
  font-weight: 600;
  font-size: var(--font-size-base);
}

.notes-text {
  color: var(--color-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  word-wrap: break-word; /* Handle long words */
}

.notes-text em {
  color: var(--color-tertiary);
  font-style: italic;
}

/* Default display for larger screens */
.workout-actions-desktop,
.description-header-desktop,
.workout-description-desktop {
  display: block !important;
}

.workout-actions-mobile,
.description-header-mobile,
.workout-description-mobile {
  display: none !important;
}

/* Mobile responsive layout for exercise items */
@media (max-width: 768px) {
  .exercise-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  /* Move action buttons and description below workout summary */
  .workout-actions-desktop,
  .description-header-desktop,
  .workout-description-desktop {
    display: none !important;
  }

  .workout-actions-mobile,
  .description-header-mobile,
  .workout-description-mobile {
    display: block !important;
  }

  /* Reduce workout title font size on mobile */
  .workout-title {
    font-size: var(--font-size-3xl); /* Drop from 4xl to 3xl */
  }
}
