@charset "UTF-8";

:root {
  /* カラーパレット */
  --color-primary: #6eac90;
  --color-primary-light: #e9f4ef;
  --color-primary-shadow: #c9dbd3;
  --color-secondary: #bdd275;
  --color-white: #fff;
  --color-black: #000;
  --color-gray: #999;
  --color-border: #ccc;
  --color-border-light: #e5e7eb;
  --color-background: #f8f7f0;
  --color-saturday: #e2ecfc;
  --color-holiday: #ffd8d8;
  --color-reservation: #fee2e2;
  --color-dermatology: #fef9c3;
  --color-soka: #dcfce7;
  --color-tachikawa: #dbeafe;
  --color-welness: #ffedd5;
  --color-kumegawa: #f3e8ff;
}

.schedule-container {
  padding: 40px 50px 60px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--color-primary-light);
  box-shadow: 6px 6px 0 0 var(--color-primary-shadow);
}

.c-calendar .hidden-md {
  display: none;
}

.c-calendar .btn {
  text-align: center;
  margin-bottom: 20px;
}

.c-calendar .desc {
  margin-bottom: 16px;
  font-size: 14px;
}

.c-calendar .note {
  margin-top: 20px;
  font-size: 14px;
}

.c-calendar .calendar-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.c-calendar .calendar-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.calendar-table th,
.calendar-table td {
  white-space: nowrap;
  padding: 15px 0;
  text-align: center;
  font-size: 14px;
}

.calendar-table th {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* .calendar-table tr:nth-child(2) th.time-period:first-child {
  border-left: 1px solid var(--color-border);
} */

.calendar-table td {
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.calendar-table td:first-child {
  border-left: 1px solid var(--color-border);
}

/* 朝・夕の境界線を点線に */
.calendar-table th.time-period:nth-child(even) {
  border-right: 1px solid var(--color-border);
}

.calendar-table th.time-period:nth-child(odd) {
  border-right: 1px dashed var(--color-border);
}

.calendar-table tr:first-child th {
  background-color: var(--color-background);
  width: calc(100% / 8);
  font-weight: bold;
  border-right: 1px solid var(--color-border);
}

.calendar-table tr:first-child th.none {
  border-left: 1px solid var(--color-border);
}

.calendar-table tr {
  background: var(--color-white);
}

.calendar-table .day {
  margin-bottom: 5px;
}

/* 予約 */
.calendar-table .shift-reservation {
  background-color: var(--color-reservation);
}
/* 皮膚科 */
.calendar-table .shift-dermatology {
  background-color: var(--color-dermatology);
}
/* 久米川動物病院 */
.calendar-table .shift-kumegawa {
  background-color: var(--color-kumegawa);
}
/* 草加みどり動物病院 */
.calendar-table .shift-soka {
  background-color: var(--color-soka);
}
/* 立川みどり動物病院 */
.calendar-table .shift-tachikawa {
  background-color: var(--color-tachikawa);
}
/* どうぶつウェルネスセンター */
.calendar-table .shift-welness {
  background-color: var(--color-welness);
}

.calendar-table tr:first-child .saturday {
  background-color: var(--color-saturday);
}

.calendar-table tr:first-child .sunday,
.calendar-table tr:first-child .holiday {
  background-color: var(--color-holiday);
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  cursor: pointer;
  background-color: var(--color-primary);
  transition: all 0.3s ease;
  user-select: none;
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
}

.nav-button:disabled {
  opacity: 0;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-icon {
  width: 18px;
  color: var(--color-white);
}

.is-loading {
  position: relative;
  height: 250px;
}

.is-loading:before {
  content: "読み込み中";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 40px);
}

.is-loading:after {
  content: "";
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 50px;
  height: 50px;
  border: 5px solid var(--color-black);
  border-right: 5px solid transparent;
  border-radius: 50%;
  animation: is-loading 2s linear infinite;
}

@keyframes is-loading {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
    opacity: 0.3;
  }
}

/* スマホ対応のスタイル */
@media (width < 768px) {
  .schedule-container {
    padding: 24px 16px 40px;
  }

  .c-calendar .calendar-table-wrap {
    position: relative;
    max-height: 600px;
    overflow-y: auto;
  }

  .c-calendar .calendar-table {
    width: 770px;
    border-collapse: separate;
    border-spacing: 0;
  }

  .calendar-table th,
  .calendar-table td {
    font-size: 12px;
  }

  /* 獣医師名の列を固定 */
  .calendar-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: var(--color-white);
  }

  /* 日付と朝・夕のヘッダー行を固定 */
  .calendar-table tr:first-child th {
    width: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    border-right: 1px solid var(--color-border);
  }

  .calendar-table tr:nth-child(2) th {
    position: sticky;
    top: 55px; /* 1行目の高さ分下に配置 */
    z-index: 20;
    background-color: var(--color-background);
    border-top: none;
  }

  .calendar-table tr:first-child .sunday {
    border-right: 1px solid var(--color-border);
  }

  .is-loading {
    height: 200px;
  }
}
