/**
 * 日历组件专属样式：周日历条与全月日历弹层
 */

.calendar-card {
  padding: 16px;
  margin-bottom: 4px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-nav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-nav-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.toggle-month-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.toggle-month-btn:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.toggle-month-btn .toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.25s ease;
}

.toggle-month-btn.expanded .toggle-icon {
  transform: rotate(180deg);
}

/* 周视图 7 天胶囊卡片容器 */
.week-days-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.week-day-pill {
  background: var(--bg-tertiary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
  user-select: none;
}

.week-day-pill:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

.week-day-pill .day-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.week-day-pill .day-number {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.week-day-pill.today {
  border-color: var(--text-muted);
}

.week-day-pill.today .day-number {
  text-decoration: underline;
  text-decoration-color: var(--brand-red);
  text-underline-offset: 3px;
}

/* 选中状态 */
.week-day-pill.active {
  background: var(--brand-red) !important;
  border-color: var(--brand-red) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

.week-day-pill.active .day-name,
.week-day-pill.active .day-number {
  color: #ffffff !important;
}

/* 有训练记录的小圆点/徽标 */
.workout-dot-badge {
  width: 6px;
  height: 6px;
  background-color: var(--brand-red);
  border-radius: 50%;
  margin-top: 4px;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.8);
}

.week-day-pill.active .workout-dot-badge {
  background-color: #ffffff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.9);
}

.empty-dot {
  width: 6px;
  height: 6px;
  margin-top: 4px;
}

/* === 全月展开日历视图 === */
.month-expand-drawer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  animation: slideDown 0.25s ease-out forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.month-view-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border-color);
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.month-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.month-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
}

.month-week-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

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

.month-cell {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.month-cell:hover {
  border-color: var(--brand-red);
}

.month-cell.out-month {
  opacity: 0.35;
}

.month-cell.has-workout {
  background: var(--brand-red-light);
  color: var(--brand-red);
  font-weight: 700;
}

.month-cell.today {
  border-color: var(--text-muted);
}

.month-cell.active {
  background: var(--brand-red) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.cell-workout-indicator {
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-red);
}

.month-cell.active .cell-workout-indicator {
  background: #ffffff;
}
