/* ==========================================================================
   MAXFIT · workout history calendar
   Loads on top of card/styles.css + workout/styles.css.
   ========================================================================== */

.calendar {
  gap: 16px;
}

.calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar__nav-btn {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--grey-light);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 48px;
  height: 48px;
  cursor: pointer;
}

.calendar__nav-btn:active {
  border-color: var(--red);
  color: var(--red);
}

.calendar__month-label {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  color: var(--white);
}

.calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.calendar__weekdays span {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--dim);
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar__day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--grey-light);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.calendar__day--empty {
  visibility: hidden;
}

.calendar__day--active {
  color: var(--white);
  background: rgba(224, 0, 0, 0.16);
  border-color: var(--red);
  cursor: pointer;
}

.calendar__day--active:active {
  background: rgba(224, 0, 0, 0.3);
}

.calendar__day--today {
  box-shadow: inset 0 0 0 2px var(--grey-light);
}

.calendar__hint {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dim);
  margin: 0;
  text-align: center;
}

.calendar__detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.calendar__detail[hidden] {
  display: none;
}

.calendar__detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar__detail-close {
  font-family: var(--font-head);
  font-size: 20px;
  line-height: 1;
  color: var(--dim);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.calendar__detail-close:active {
  color: var(--red);
}

.calendar__detail-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar__undo-btn {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--grey-light);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}

.calendar__undo-btn[hidden] {
  display: none;
}

.calendar__undo-btn:active {
  border-color: var(--red);
  color: var(--red);
}

.calendar__save-status {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dim);
  margin: -6px 0 0;
}

.calendar__save-status[hidden] {
  display: none;
}

.calendar__save-status--error {
  color: var(--red);
}

.calendar__detail-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar__detail-workout {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar__detail-workout-name {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--red);
  margin: 0;
}

.calendar__detail-notes {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  color: var(--grey-light);
  margin: -2px 0 0;
}

.calendar__detail-exercise-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
}

.calendar__detail-empty {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dim);
  margin: 0;
}

.calendar__edit-exercise {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.calendar__edit-exercise-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar__remove-exercise {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--dim);
  background: transparent;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px;
}

.calendar__remove-exercise:active {
  color: var(--red);
}

.calendar__edit-sets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calendar__edit-set {
  display: grid;
  grid-template-columns: 44px 1fr 1fr 26px;
  align-items: center;
  gap: 8px;
}

.calendar__edit-set-num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--dim);
}

.calendar__edit-input {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  color: var(--white);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  height: 36px;
  padding: 0 4px;
  min-width: 0;
}

.calendar__edit-input:focus {
  outline: none;
  border-color: var(--red);
}

.calendar__remove-set {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--dim);
  background: transparent;
  border: none;
  cursor: pointer;
  height: 36px;
}

.calendar__remove-set:active {
  color: var(--red);
}

.calendar__add-set {
  align-self: flex-start;
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--grey-light);
  background: transparent;
  border: 1px dashed var(--line-strong, var(--line));
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
}

.calendar__add-set:active {
  border-color: var(--red);
  color: var(--red);
}
