@charset "UTF-8";

:root {
  --primary-color: #4bc9c1;
  --secondary-color: #e8e8e8;
  --black: #333;
  --gray: #e8e8e8;
  --white: #fff;
}

.c-calendar {
  max-width: 1000px;
  margin-inline: auto;
}

/*--------------------------------------------------
  calendar controls
--------------------------------------------------*/
.c-calendar__header {
  display: grid;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.calendar-date {
  font-size: 16px;
  color: var(--black);
}

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

.nav-button:hover {
  background-color: #f9fafb;
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-icon {
  width: 18px;
}

/*--------------------------------------------------
  calendar table
--------------------------------------------------*/
.calendar-month,
.calendar-week {
  overflow-y: auto;
}

.calendar-week {
  display: none;
}

.c-calendar-table {
  border-collapse: collapse;
  border-left: solid 1px #d5d7db;
  border-top: solid 1px #d5d7db;
  width: 100%;
  table-layout: fixed;
}

.c-calendar-table th,
.c-calendar-table td {
  font-size: 14px;
  text-align: center;
  width: calc(100% / 7);
  border-right: solid 1px #d5d7db;
  border-bottom: solid 1px #d5d7db;
}

.c-calendar-table th {
  border-bottom: none;
  padding: 8px 0;
}

.c-calendar-table .date {
  padding: 8px 0;
}

.c-calendar-table .schedule {
  vertical-align: top;
  height: 150px;
}

.c-calendar-table .schedule.other-month {
  background-color: #f5f5f5;
}

.c-calendar-table td span {
  display: block;
  border-radius: 5px;
  padding: 6px 8px;
  margin-right: 4px;
  margin-bottom: 2px;
  font-size: 11px;
  text-align: left;
  line-height: 1.25;
}

.c-calendar-table .saturday {
  color: #0059b3;
  background-color: #e6f2ff;
}

.c-calendar-table .sunday,
.c-calendar-table .holiday {
  color: #cc0000;
  background-color: #ffebeb;
}

.c-calendar-table .today,
.c-calendar-table .today.sunday,
.c-calendar-table .today.saturday,
.c-calendar-table .today.holiday {
  color: inherit;
  background-color: #fff2a8;
}

/*--------------------------------------------------
  toggle-button
--------------------------------------------------*/
.c-calendar__toggle {
  grid-column: 3;
}

.toggle-container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 180px;
  border: 3px solid #f3f4f6;
  border-radius: 20px;
  background: #f3f4f6;
  cursor: pointer;
  margin-left: auto;
}

.toggle-container::before {
  content: "";
  position: absolute;
  width: 50%;
  height: 100%;
  top: -1px;
  left: 0%;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid #d5d7db;
  transition: all 0.3s;
}

.toggle-checkbox:checked + .toggle-container::before {
  left: 50%;
}

.toggle-container .label {
  padding: 6px;
  text-align: center;
  z-index: 1;
  font-size: 14px;
}

.toggle-checkbox {
  display: none;
}

/* トグルボタンの色変更を統合 */
/* .toggle-checkbox + .toggle-container .label:first-child,
.toggle-checkbox:checked + .toggle-container .label:last-child {
  color: #4f46e5;
  transition: color 0.3s;
} */

.toggle-checkbox + .toggle-container .label:last-child,
.toggle-checkbox:checked + .toggle-container .label:first-child {
  color: #030712;
  transition: color 0.3s;
}

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

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

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

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

/*--------------------------------------------------
  responsive
--------------------------------------------------*/
@media screen and (max-width: 768px) {
  .c-calendar__header {
    grid-template-rows: auto auto;
  }

  .c-calendar-table {
    width: 960px;
  }

  .toggle-container {
    width: 150px;
    margin-inline: auto;
  }
}
