/**
 * Routines Page Styles
 * Matches AG102 Exercise Library dark theme
 */

/* ===== Routines Listing Page ===== */

.routines-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.routines-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.routines-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary, #fff);
}

.hero-subtitle {
  color: var(--text-muted, rgba(255,255,255,0.6));
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Filter buttons */
.routines-filter {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary, rgba(255,255,255,0.7));
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.filter-btn:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
}

.filter-btn.active {
  border-color: var(--accent-gold, #D4A84B);
  background: rgba(212,168,75,0.15);
  color: var(--accent-gold, #D4A84B);
}

/* Routine cards grid */
.routines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.routine-card {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.routine-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.routine-header {
  background: var(--routine-color, #4a90a4);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.routine-icon {
  font-size: 2.5rem;
}

.routine-duration {
  background: rgba(255,255,255,0.2);
  padding: 0.35rem 0.85rem;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.routine-body {
  padding: 1.5rem;
}

.routine-name {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary, #fff);
}

.routine-description {
  color: var(--text-muted, rgba(255,255,255,0.6));
  margin-bottom: 1rem;
  line-height: 1.5;
}

.routine-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 0.9rem;
  color: var(--text-secondary, rgba(255,255,255,0.7));
}

.meta-icon {
  margin-right: 0.25rem;
}

.routine-equipment {
  font-size: 0.85rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-bottom: 0.75rem;
}

.equipment-label {
  font-weight: 500;
}

.routine-pillars {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pillar-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: var(--pillar-color, #888);
  border: 1px solid var(--pillar-color, #888);
}

.routine-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-start-routine {
  display: block;
  text-align: center;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--primary-green, #2D5A3D), var(--accent-gold, #D4A84B));
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-start-routine:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ===== Routine Player Page ===== */

.routine-player-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
}

.player-section {
  animation: fadeIn 0.3s ease;
}

.player-section.hidden {
  display: none;
}

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

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted, rgba(255,255,255,0.6));
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-primary, #fff);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

/* Intro section */
.intro-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  margin-bottom: 2rem;
  border: 1px solid rgba(255,255,255,0.1);
}

.intro-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.intro-card h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary, #fff);
}

.intro-description {
  color: var(--text-muted, rgba(255,255,255,0.6));
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.intro-meta {
  color: var(--text-secondary, rgba(255,255,255,0.7));
  font-size: 1rem;
}

.meta-separator {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.intro-best-for {
  margin-top: 1rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 0.9rem;
}

/* Exercise preview list */
.exercise-preview h3,
.routine-benefits h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary, #fff);
}

.exercise-preview-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 0;
}

.exercise-preview-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary, rgba(255,255,255,0.8));
}

.exercise-preview-list li:last-child {
  border-bottom: none;
}

.preview-time {
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 0.9rem;
}

/* Benefits list */
.routine-benefits {
  margin-top: 1.5rem;
}

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

.benefits-list li {
  padding: 0.5rem 0;
  color: #27ae60;
  font-size: 0.95rem;
}

/* Start button */
.btn-large {
  width: 100%;
  padding: 1.1rem;
  font-size: 1.2rem;
  margin-top: 2rem;
}

/* Active player */
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.routine-title {
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.exercise-counter {
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 0.9rem;
}

.progress-bar-container {
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-green, #2D5A3D), var(--accent-gold, #D4A84B));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.current-exercise {
  text-align: center;
  padding: 2rem 0;
}

.current-exercise .exercise-name {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary, #fff);
}

.timer-display {
  font-size: 5rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--text-primary, #fff);
  transition: color 0.3s;
  line-height: 1;
}

.timer-display.timer-urgent {
  color: #e74c3c;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.rep-display {
  font-size: 1.3rem;
  color: var(--accent-gold, #D4A84B);
  margin-top: 0.5rem;
  font-weight: 500;
}

.exercise-instruction {
  font-style: italic;
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-top: 1rem;
  font-size: 1.1rem;
}

/* Exercise visual */
.exercise-visual {
  margin: 2rem 0;
}

.visual-link {
  text-decoration: none;
}

.visual-placeholder {
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted, rgba(255,255,255,0.4));
  border: 1px dashed rgba(255,255,255,0.2);
  transition: all 0.2s;
}

.visual-placeholder:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
}

.visual-icon {
  font-size: 2rem;
}

.visual-text {
  font-size: 0.85rem;
}

/* Player controls */
.player-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 2rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary, rgba(255,255,255,0.7));
}

.control-btn:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
}

.control-btn-primary {
  background: linear-gradient(135deg, var(--primary-green, #2D5A3D), var(--accent-gold, #D4A84B));
  border-color: transparent;
  color: white;
}

.control-btn-primary:hover {
  opacity: 0.9;
}

.control-icon {
  font-size: 1.5rem;
}

.control-label {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.next-up {
  text-align: center;
  color: var(--text-muted, rgba(255,255,255,0.5));
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  font-size: 0.95rem;
}

.next-up span {
  color: var(--text-secondary, rgba(255,255,255,0.7));
}

/* Exit button */
.btn-exit {
  display: block;
  width: 100%;
  margin-top: 2rem;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: var(--text-muted, rgba(255,255,255,0.5));
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.btn-exit:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* Paused state */
.paused .current-exercise {
  opacity: 0.6;
}

.paused .timer-display::after {
  content: 'PAUSED';
  font-size: 1rem;
  display: block;
  color: #f39c12;
  font-family: 'Inter', sans-serif;
  margin-top: 0.5rem;
}

/* Completion section */
.completion-content {
  text-align: center;
  padding: 2rem 0;
}

.completion-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.completion-content h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary, #fff);
}

.completion-subtitle {
  color: var(--text-muted, rgba(255,255,255,0.6));
  font-size: 1.1rem;
}

/* Motivational quote */
.motivational-quote {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--accent-gold, #D4A84B);
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: rgba(212, 168, 75, 0.08);
  border-radius: 12px;
  border-left: 4px solid var(--accent-gold, #D4A84B);
  line-height: 1.6;
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-gold, #D4A84B);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted, rgba(255,255,255,0.5));
}

.completion-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.completion-actions .btn {
  min-width: 150px;
}

.btn-success {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-success:hover {
  background: linear-gradient(135deg, #219a52 0%, #27ae60 100%);
  transform: translateY(-1px);
}

.suggested-next {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.suggested-next h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary, rgba(255,255,255,0.7));
}

.suggested-routine {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: var(--text-secondary, rgba(255,255,255,0.8));
  transition: background 0.2s;
}

.suggested-routine:hover {
  background: rgba(255,255,255,0.1);
}

.suggested-icon {
  font-size: 1.5rem;
}

.suggested-name {
  flex: 1;
  font-weight: 500;
}

.suggested-duration {
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 0.9rem;
}

/* Loading and error states */
.loading-state,
.error-state {
  text-align: center;
  padding: 3rem;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .routines-page {
    padding: 1rem;
  }

  .routines-hero h1 {
    font-size: 2rem;
  }

  .routines-grid {
    grid-template-columns: 1fr;
  }

  .timer-display {
    font-size: 4rem;
  }

  .control-btn {
    padding: 0.75rem 1.25rem;
  }

  .completion-stats {
    gap: 2rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .completion-actions {
    flex-direction: column;
  }

  .completion-actions .btn {
    width: 100%;
  }
}
