@charset "UTF-8";

:root {
  /* カラーパレット */
  --color-primary: #74a92d;
  --color-primary-light: rgba(116, 169, 45, 0.05);
  --color-primary-shadow: #c9dbd3;
  --color-white: #fff;
  --color-light-gray: #ececec;
  --color-black: #000;
  --color-gray: #999;
  --color-border: #ccc;
  --color-border-light: #e5e7eb;
  --color-saturday: #e2ecfc;
  --color-holiday: #ffd8d8;
}

.shift-available {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: var(--color-primary);
  border-radius: 50%;
}

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

.c-calendar .desc-legend {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.calendar-month-title {
  text-align: center;
  margin-bottom: 10px;
  font-size: 18px;
}

.c-calendar .calendar-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
  -webkit-overflow-scrolling: touch;
}

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

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

.calendar-table th,
.calendar-table td {
  border: 1px solid var(--color-border);
  white-space: nowrap;
  padding: 12px 0;
  text-align: center;
}

.calendar-table td {
  vertical-align: middle;
}

/* ヘッダー行を上部に固定 */
.calendar-table thead tr th:not(:first-child) {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* 2行目のAM/PM行は1行目の下に固定 */
.calendar-table thead tr:nth-child(2) th:not(:first-child) {
  top: 45px;
}

/* 最初の列（空のセル）の背景色を確実に白に */
.calendar-table thead th:first-child {
  background-color: var(--color-white);
}

.date-cell.saturday {
  background-color: var(--color-saturday);
}
.date-cell.sunday,
.date-cell.holiday {
  background-color: var(--color-holiday);
}

/* 偶数番目の医師の列の背景色 */
.doctor-even,
.shift-cell.doctor-even,
.calendar-table thead tr th.doctor-even {
  background-color: var(--color-light-gray);
}

.doctor-header.doctor-even,
.time-period.doctor-even {
  background-color: var(--color-light-gray);
}

.calendar-table thead tr th.doctor-odd {
  background-color: var(--color-white);
}

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

.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;
  }
}

.is-loading .tab-list {
  display: none;
}

.is-loading [role="tabpanel"] {
  display: none;
}

.tab {
  width: 100%;
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 90%;
  margin-inline: auto;
}

.tab-item {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-bottom: none;
  transition: all 0.2s ease;
  border-radius: 10px 10px 0 0;
  position: relative;
  cursor: pointer;
  font-size: 16px;
  text-align: center;
  font-weight: bold;
  padding: 20px 0;
}

.tab-item[role="tab"][aria-selected="true"] {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.tab-panel {
  padding: 40px 50px 60px;
  overflow: visible;
  border-radius: 18px;
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
}

.tab-note {
  display: none;
}

/* スマホ対応のスタイル */
@media (width < 768px) {
  .c-calendar .calendar-table {
    width: 770px;
  }

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

  /* 2行目のAM/PM行は1行目の下に固定 */
  .calendar-table thead tr:nth-child(2) th:not(:first-child) {
    top: 42px;
  }

  .tab-panel {
    padding: 20px 1em 30px;
  }

  .tab-item {
    font-size: 12px;
  }
}
