/* カレンダービュー全体のスタイル */
.calendar-view {
  padding: 8px 15px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* カレンダーヘッダー */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.calendar-header__title {
  font-size: 1.6rem;
  font-weight: bold;
  color: #333;
  margin: 0;
}

.calendar-header__nav {
  display: flex;
  gap: 15px;
}

.calendar-header__nav-link {
  padding: 8px 16px;
  text-decoration: none;
  background-color: #f8f9fa;
  color: #333;
  border-radius: 5px;
  border: 1px solid #dee2e6;
  transition: all 0.2s;
}

.calendar-header__nav-link:hover {
  background-color: #e9ecef;
  color: #333;
}

.calendar-header__nav-link--current {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

.calendar-header__nav-link--current:hover {
  background-color: #0056b3;
  color: white;
}

/* カレンダーグリッド */
.calendar-grid {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 曜日ヘッダー */
.calendar-grid__header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  flex-shrink: 0;
}

.calendar-grid__day-name {
  padding: 2px;
  text-align: center;
  font-weight: bold;
  font-size: 0.7rem;
  color: #495057;
  border-right: 1px solid #dee2e6;
  line-height: 1;
}

.calendar-grid__day-name:last-child {
  border-right: none;
}

.calendar-grid__day-name--weekend {
  color: #495057;
}

.calendar-grid__day-name--saturday {
  color: #2563eb;
}

.calendar-grid__day-name--sunday {
  color: #e53e3e;
}

/* カレンダー本体 */
.calendar-grid__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.calendar-grid__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #dee2e6;
  flex: 1;
  min-height: 0;
}

.calendar-grid__week:last-child {
  border-bottom: none;
}

/* 日付セル */
.calendar-grid__day {
  min-height: 0;
  padding: 4px;
  border-right: 1px solid #dee2e6;
  background-color: white;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  overflow: hidden;
}

/* セル全体をクリック可能なリンクスタイル */
a.calendar-grid__day--link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

a.calendar-grid__day--link:hover {
  background-color: #f0f8ff;
  box-shadow: inset 0 0 0 2px #007bff;
  z-index: 1;
}

.calendar-grid__day:last-child {
  border-right: none;
}

.calendar-grid__day--other-month {
  background-color: #f8f9fa;
  color: #6c757d;
}

.calendar-grid__day--empty {
  background-color: #fafafa;
  cursor: default;
}

.calendar-grid__day--today {
  background-color: #fff3cd;
  box-shadow: inset 0 0 0 1px #ffc107;
}

.calendar-grid__day--weekend {
  /* 週末の背景色は設定しない */
}

.calendar-grid__day--today.calendar-grid__day--weekend {
  background-color: #fff3cd; /* 今日の日付は週末でも黄色 */
}

/* 日付ヘッダー */
.calendar-day__header {
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid #e9ecef;
}


/* 日付番号 */
.calendar-day__number {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
}

.calendar-grid__day--other-month .calendar-day__number {
  color: #adb5bd;
}

.calendar-grid__day--today .calendar-day__number {
  color: #856404;
}

.calendar-grid__day--saturday:not(.calendar-grid__day--other-month) .calendar-day__number {
  color: #2563eb;
}

.calendar-grid__day--sunday:not(.calendar-grid__day--other-month) .calendar-day__number {
  color: #e53e3e;
}


/* 日付コンテンツ */
.calendar-day__content {
  font-size: 0.8rem;
  line-height: 1.2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.calendar-day__info {
  margin-bottom: 4px;
  padding: 2px 4px;
  border-radius: 3px;
}

.calendar-day__info--staff {
  background-color: #e3f2fd;
  color: #1565c0;
}

.calendar-day__info--meals {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.calendar-day__info--stay {
  background-color: #e8f5e8;
  color: #2e7d32;
}

.calendar-day__label {
  font-weight: bold;
  margin-right: 2px;
}

.calendar-day__value {
  font-weight: normal;
}

/* 食事情報の横並び表示 */
.calendar-day__meal {
  display: inline-block;
  margin-right: 6px;
}

/* シフト表示 */
.calendar-day__shifts {
  margin-top: 6px;
  font-size: 0.75rem;
}

.calendar-day__shift {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  padding: 1px 3px;
  background-color: #e7f3ff;
  border-radius: 2px;
}

.calendar-day__staff-name {
  font-weight: bold;
  color: #1976d2;
  margin-right: 4px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day__time {
  color: #666;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.calendar-day__more {
  color: #666;
  font-style: italic;
  text-align: center;
  margin-top: 2px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .calendar-view {
    padding: 10px;
  }
  
  .calendar-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .calendar-header__title {
    font-size: 1.5rem;
  }
  
  .calendar-grid__day,
  a.calendar-grid__day--link {
    min-height: 100px;
    padding: 6px;
    font-size: 0.7rem;
  }
  
  
  .calendar-day__number {
    font-size: 1rem;
  }
  
  .calendar-day__content {
    font-size: 0.7rem;
  }
  
  .calendar-day__shifts {
    font-size: 0.65rem;
  }
}

/* 食事数表示 */
.calendar-day__meal-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-bottom: 1px;
  padding: 1px 3px;
  border-radius: 6px;
  font-weight: 600;
  min-width: 20px;
  background-color: #ffc107;
  color: #212529;
}

.calendar-day__meal-number {
  font-size: 12px;
  line-height: 1;
}

.calendar-day__meal-label {
  font-size: 9px;
  line-height: 1;
}


/* 出勤予定スタッフ数表示 */
.calendar-day__staff-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background-color: #989bc6;
  color: white;
  border-radius: 6px;
  padding: 1px 3px;
  font-weight: 500;
  margin-bottom: 1px;
}

.calendar-day__staff-count-label {
  font-size: 8px;
  line-height: 1;
}

.calendar-day__staff-count-number {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.calendar-day__staff-count-unit {
  font-size: 8px;
  line-height: 1;
}

/* 配置枠の埋まり具合を強調表示 */
.calendar-day__slot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 2px 0;
}

.calendar-day__slot-empty {
  font-size: 0.85rem;
  font-weight: 600;
  color: #adb5bd;
  letter-spacing: 0.08em;
}

.calendar-day__slot-count {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  font-weight: 700;
  line-height: 1;
}

.calendar-day__slot-filled {
  font-size: 1.1rem;
  color: #212529;
}

.calendar-day__slot-separator {
  font-size: 1.1rem;
  color: #adb5bd;
}

.calendar-day__slot-total {
  font-size: 1.1rem;
  color: #495057;
  font-weight: 600;
}

.calendar-day__slot-unit {
  font-size: 0.65rem;
  color: #868e96;
  font-weight: 500;
  padding-bottom: 1px;
}

/* モバイル対応で忙しさレベルを調整 */
@media (max-width: 768px) {
  .calendar-day__business-level {
    font-size: 9px;
    gap: 2px;
    margin-bottom: 4px;
    padding: 1px 3px;
  }
  
  .calendar-day__business-icon {
    font-size: 12px;
  }
  
  .calendar-day__business-label {
    font-size: 8px;
  }
  
  .calendar-day__staff-count {
    padding: 1px 4px;
  }
  
  .calendar-day__staff-count-label {
    font-size: 7px;
  }
  
  .calendar-day__staff-count-number {
    font-size: 10px;
  }
  
  .calendar-day__staff-count-unit {
    font-size: 7px;
  }
  
  .calendar-day__slot-info {
    gap: 2px;
    padding: 2px 0;
  }

  .calendar-day__slot-count {
    gap: 3px;
  }

  .calendar-day__slot-empty {
    font-size: 0.75rem;
  }

  .calendar-day__slot-filled,
  .calendar-day__slot-separator,
  .calendar-day__slot-total {
    font-size: 1rem;
  }

  .calendar-day__slot-unit {
    font-size: 0.6rem;
    padding-bottom: 0;
  }
  
  .calendar-day__meal-count {
    padding: 1px 4px;
    min-width: 24px;
  }
  
  .calendar-day__meal-number {
    font-size: 12px;
  }
  
  .calendar-day__meal-label {
    font-size: 8px;
  }
}

/* 未入力表示 */
.calendar-day__no-data {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  color: #6c757d;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* 最終更新日時 */
.calendar-day__updated-at {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  padding: 0;
}

.calendar-day__updated-time {
  font-size: 10px;
  color: #6c757d;
  font-style: normal;
}

.calendar-day__updated-time::before {
  content: "更新: ";
  font-weight: 600;
  margin-right: 2px;
}
