/* ===========================
   CALENDAR & SCHEDULE
   =========================== */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

.calendar-day {
  aspect-ratio: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-day:hover {
  border-color: var(--secondary);
  box-shadow: 0 2px 8px rgba(220, 20, 60, 0.15);
  transform: translateY(-2px);
}

.calendar-day.today {
  background-color: rgba(220, 20, 60, 0.05);
  border-color: var(--secondary);
  font-weight: bold;
}

.calendar-day.selected {
  background-color: rgba(100, 150, 255, 0.12);
  color: var(--primary);
  border: 3px solid var(--primary);
}

.calendar-day.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--gray-50);
  border: 2px dashed var(--gray-300);
}

.calendar-day.disabled {
  background-color: #f0f0f0;
  color: #aaa;
  border-color: #ddd;
  cursor: not-allowed;
}

.calendar-day.disabled:hover {
  border-color: #ddd;
  box-shadow: none;
  transform: none;
}

.calendar-day-number {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.calendar-day-routines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.monthly-routine-item {
  background: #f5f5f5;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.monthly-routine-item:hover {
  background: #efefef;
  transform: translateX(2px);
}

.monthly-routine-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monthly-routine-blocks {
  font-size: 0.7rem;
  color: #666;
  margin-top: 0.1rem;
}

.btn-create-routine {
  background: linear-gradient(135deg, #22863a, #1f6f2e);
  border: none;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(34, 134, 58, 0.3);
}

.btn-create-routine:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(34, 134, 58, 0.4);
}

/* Schedule Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.schedule-time-slot {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

.schedule-block {
  padding: 1rem;
  border-radius: 6px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-block:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.schedule-block-time {
  font-weight: 600;
  font-size: 0.9rem;
}

.schedule-block-name {
  font-weight: 500;
  font-size: 0.85rem;
}

.schedule-block-exercises {
  font-size: 0.75rem;
  opacity: 0.9;
  max-height: 60px;
  overflow-y: auto;
}

/* Exercise List */
.exercises-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.exercise-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}

.exercise-field input {
  padding: 0.6rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.exercise-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Rep Type Toggle */
.rep-type-toggle-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rep-type-toggle {
  display: flex;
  gap: 0.25rem;
  background: #f0f0f0;
  padding: 0.25rem;
  border-radius: 6px;
}

.rep-type-btn {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  color: #666;
}

.rep-type-btn:hover {
  border-color: var(--primary);
}

.rep-type-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.exercise-reps-value {
  margin-top: 0.25rem;
}

/* Weights Container */
.exercise-weights-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.weights-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.weights-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  padding: 0.25rem 0;
}

.weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.4rem;
}

.exercise-weight-item {
  padding: 0.5rem !important;
  text-align: center;
  font-size: 0.85rem;
}

.exercise-field .exercise-remove {
  padding: 0.6rem;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
  align-self: flex-end;
  min-width: 40px;
}

.exercise-field .exercise-remove:hover {
  background-color: #c82333;
}

/* Detail View */
.detail-view-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-day-section {
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.detail-day-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--dark);
}

.detail-routine-item {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.detail-routine-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.detail-block-list {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
}

#routineBlocksList {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-block-item {
  padding: 1rem;
  background: #eef6ff;
  border-left: 4px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.detail-block-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-block-name {
  font-weight: 700;
  font-size: 1rem;
}

.detail-block-time {
  font-size: 0.85rem;
  color: #666;
}

.detail-block-complete {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid #ddd;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

.detail-block-exercises {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  padding: 0.5rem;
}

.block-exercise-item {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: flex-start;
  flex-wrap: wrap;
}

.block-exercise-item:last-child {
  border-bottom: none;
}

.block-exercise-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  flex-shrink: 0;
}

.block-exercise-name {
  font-size: 0.95rem;
}

/* Sets Buttons Container */
.exercise-sets-container {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-shrink: 0;
}

.sets-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.set-btn {
  padding: 0.35rem 0.6rem;
  background: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
  transition: all 0.2s ease;
}

.set-btn:hover {
  border-color: var(--primary);
  background: #f8f8f8;
}

.set-btn.completed {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

.set-btn.completed::after {
  content: ' ✓';
}

.exercise-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  width: auto;
  justify-content: flex-end;
}

.block-exercise-meta {
  display: flex;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #666;
  padding-left: 0;
  flex-wrap: wrap;
  align-items: center;
}

.exercise-badge {
  background: #eef2f6;
  border: 1px solid #d7dfe7;
  color: #333;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.exercise-note {
  background: #fff3cd;
  border: 1px solid #ffe08a;
  color: #7a5a00;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

.block-exercise-empty {
  color: #888;
  font-style: italic;
}

.detail-block-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
}

/* Clock Picker */
.clock-container {
  width: 300px;
  height: 300px;
  margin: 0 auto;
}

.clock-svg {
  width: 100%;
  height: 100%;
}

/* Mini Calendar */
#miniCalendarContainer {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  font-size: 0.8rem;
}

.mini-calendar-day {
  aspect-ratio: 1;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 500;
  background: white;
  transition: all 0.2s;
}

.mini-calendar-day:hover {
  border-color: var(--primary);
  background: rgba(0, 123, 255, 0.05);
}

.mini-calendar-day.selected {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.mini-calendar-day.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Routine Cards */
.routine-card {
  padding: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.routine-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.routine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.routine-card-color {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.routine-card-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--dark);
}

.routine-card-date {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.25rem;
}

.routine-card-blocks-count {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

/* File Input */
.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.file-input-wrapper input[type="file"] {
  display: none;
}

.file-name {
  color: #666;
  font-size: 0.9rem;
}

/* Import Steps */
.import-step {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.current-file-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
}

.template-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Metrics */
.metric-card {
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.9rem;
  color: #666;
}

/* Timer Display */
.timer-display {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.timer-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  min-width: 300px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.timer-content.timer-active {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

.timer-content.timer-rest {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: white;
}

.timer-phase {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.timer-time {
  font-size: 3.5rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.timer-progress {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.timer-progress-bar {
  height: 100%;
  background: white;
  transition: width 0.2s linear;
}

.timer-phases {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.timer-phase-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.timer-phase-indicator.active {
  background: white;
  color: #007bff;
  border-color: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.timer-phase-indicator.completed {
  background: rgba(255, 255, 255, 0.4);
  border-color: white;
}

.timer-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #28a745;
}
/* ===========================
   MINI CALENDAR (Para modales)
   =========================== */

.mini-calendar {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.mini-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.mini-month-year {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.mini-nav-btn {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 700;
  color: var(--primary);
}

.mini-nav-btn:hover {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.mini-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.mini-day-label {
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: #666;
  padding: 0.5rem;
}

.mini-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.mini-day-cell:hover {
  background: rgba(220, 20, 60, 0.1);
  border-color: var(--secondary);
}

.mini-day-empty {
  cursor: default;
  background: transparent;
}

.mini-day-past {
  opacity: 0.4;
}

.mini-day-today {
  background: var(--secondary);
  color: white;
  font-weight: 700;
}

.mini-day-today:hover {
  background: #b71234;
}