/* --- CSS Variables --- */
:root {
    --bg-main: #2a2a2a;
    --bg-card: rgba(12, 12, 12, 0.8);
    --bg-card-header: #1c1c1c;
    --bg-exercise-item: #252525;
    --bg-superset: #1c1c1c;
    --bg-superset-header: #1b1a1a;
    --border-color: rgba(255, 255, 255, 0.2);
    --border-color-light: rgba(255, 255, 255, 0.05);
    --text-primary: #f5f5f5;
    --text-secondary: #a1a1aa;
    --accent-yellow: #facc15;
    --accent-green: #4caf50;
    --font-family: 'Inter', sans-serif;
}

/* --- General & Reset Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    font-family: var(--font-family);
    color: var(--text-primary);
    font-size: 12px;
    padding-bottom: 140px; /* Increased space for fixed footer to prevent content being hidden */
    /* Prevent overscroll on mobile */
    overscroll-behavior: none;
    /* Handle safe area for devices with notches */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.container {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 16px;
}

button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
}

/* --- Header Section --- */
/* Most header styles encapsulated in <workout-header> component */
/* See: pages/workout/components/workout-header.js */

/* Override the global * reset for the custom element */
workout-header {
    display: block;
    margin-top: 12px;
    margin-bottom: 24px;
}

/* Desktop Grid View Specific Styles - Override nested styles */
.workout-plan.workout-grid-view .exercise-thumbnail {
    width: 80px !important;
    height: 80px !important;
}

.workout-plan.workout-grid-view .exercise-content p {
    font-size: 14px !important;
}

.workout-plan.workout-grid-view .set-label {
    font-size: 14px !important;
}

.workout-plan.workout-grid-view .round-counter {
    font-size: 14px !important;
}

.workout-plan.workout-grid-view .superset-title {
    font-size: 16px !important;
}


.workout-plan.workout-grid-view .rep-helper {
    font-size: 14px !important;
    color: inherit !important;
    opacity: 1 !important;
}

.workout-plan.workout-grid-view .exercise-details span[data-reps] {
    font-size: 14px !important;
}

.workout-plan.workout-grid-view .checkmark-circle {
    width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.workout-plan.workout-grid-view .checkmark-circle svg {
    width: 16px !important;
    height: 16px !important;
}

/* NEW Badge Styling */
.new-badge {
    display: inline-block;
    background: transparent;
    color: white;
    font-size: 10px;
    font-weight: 400;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    vertical-align: middle;
}

/* NEW Badge in Grid View */
.workout-plan.workout-grid-view .new-badge {
    font-size: 9px;
    padding: 1px 5px;
    margin-left: 4px;
}

/* New structure for both grid and list views */
.sets-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 20px;
    gap: 0px;
}

.set-label {
    font-size: 14px;
    white-space: nowrap;
    text-align: left;
    min-width: 40px; /* Mobile: Fixed width for consistent alignment */
}

@media (min-width: 769px) {
    .set-label {
        min-width: 48px; /* Desktop: Fixed width for consistent alignment */
    }
}

.checkmark-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Workout Plan styles migrated to <workout-plan> component */
/* See: pages/workout/components/workout-plan.js */

/* --- Grid View Styles (Global - for scoping) --- */
/* These remain global because they scope child component styles */
.workout-plan.workout-grid-view .exercise-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.workout-plan.workout-grid-view .exercise-item.indented {
    padding-left: 45px;
    position: relative;
}

.workout-plan.workout-grid-view .exercise-item.indented .dot {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.workout-plan.workout-grid-view .exercise-thumbnail {
    width: 74px;
    height: 74px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.workout-plan.workout-grid-view .exercise-thumbnail-placeholder {
    background-color: white;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

  .workout-plan.workout-grid-view .exercise-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
  }

.workout-plan.workout-grid-view .exercise-content p {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workout-plan.workout-grid-view .exercise-details span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workout-plan.workout-grid-view .exercise-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    min-height: 20px;
}


.workout-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}


/* Exercise list styles migrated to <exercise-list> component */
/* See: pages/workout/components/exercise-list.js */

/* --- Particle Animation Styles (Global - created in body by ViewRenderer) --- */
.particle {
  position: fixed;
  width: 4px;
  height: 4px;
  background-color: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  opacity: 1;
}

.particle-trail {
  position: fixed;
  width: 2px;
  height: 2px;
  background-color: white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.6;
}

/* --- Customization Prompt Modal --- */
.customization-prompt-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999; /* Above site-backdrop (9998) but below intro modal (10000+) */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.customization-prompt-backdrop.active {
  opacity: 1;
}

.customization-prompt-modal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 400px;
  width: calc(100% - 32px);
  backdrop-filter: blur(20px);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.customization-prompt-modal.active {
  transform: translateY(0) scale(1);
}

.customization-prompt-content {
  text-align: center;
}

.customization-prompt-header {
  margin-bottom: 24px;
}

.customization-prompt-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

.customization-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customization-btn {
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-family);
}

.customization-btn.primary {
  background-color: var(--accent-yellow);
  color: #000;
}

.customization-btn.primary:hover {
  background-color: #e6b800;
  transform: translateY(-1px);
}

.customization-btn.secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.customization-btn.secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.customization-btn.tertiary {
  background-color: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 13px;
  padding: 8px 12px;
}

.customization-btn.tertiary:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Checkmark completion animation */
.checkmark-circle.completing {
  animation: checkmarkPulse 0.3s ease-out;
}

@keyframes checkmarkPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}


/* --- Mobile Styles --- */
@media (max-width: 768px) {
  /* Add container padding for proper spacing */
  .container {
    padding: 0 8px;
  }
  
  /* Restore borders and border radius, add left/right spacing */
  .workout-card {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 0;
  }
  
  /* Mobile exercise styles migrated to <exercise-list> component */
  /* See: pages/workout/components/exercise-list.js */
}