/* ================= Base (スマホ向け) ================= */
#calendar-container {
  padding: 8px;
  font-size: 0.65em;
  background: #fff;
  position: relative;
}

.calendar-weekday, .calendar-day {
    text-align: center;
    font-weight: 700;
}

.calendar-weekday {
    font-family: "Lilita One", sans-serif;
    padding-bottom: 10px;
    color: #555;
}

.calendar-day {
    padding: 8px 0;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.saturday { color: var(--color-accent1, #2196f3); }
.calendar-day.sunday { color: var(--color-accent2, #f44336); }

.calendar-day.today {
    background-color: var(--color-primary, #f5a623);
    color: #fff;
}

/* 凡例表示 */
.calendar-legend {
  display: flex;
  gap: 2rem;
  align-items: right;
  margin-bottom: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  font-size: .7rem;
}
.legend-circle {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.legend-kichijoji {
  background: #d32f2f; /* 赤 */
  border: 2px solid #d32f2f;
}
.legend-sagamihara {
  background: #388e3c; /* 緑 */
  border: 2px solid #388e3c;
}

/* レッスン日下にドット */
.calendar-day.event-kichijoji::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent2, #f44336);
}
.calendar-day.event-sagamihara::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: green;
}
.calendar-day.event-both::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 40%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent2, #f44336);
  box-shadow: 10px 0 green;
}

/* 休講日 */
.calendar-day.holiday {
    background-color: #aca9a9;
    color: #aca9a9;
    cursor: default !important;
}
.calendar-day.holiday::after {
  content: '休';
  color: red;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
}


#toggleViewBtn{
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
#toggleViewBtn:active {
  background: #2573a7;
  transform: scale(0.96);
}

/* === オーバーレイ背景 === */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1900;
}
.popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* === ポップアップ === */
.lesson-popup {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.2s ease, transform 0.2s ease;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 90%;
  max-height: 80%;
  overflow-y: auto;
  z-index: 2000;
}

.lesson-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* === PC用：日付の下に絶対配置 === */
@media (min-width: 768px) {

}


/* === ヘッダーと閉じるボタン === */
.popup-header {
  position: relative;
  width: 99%;
  text-align: center;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
}

.popup-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2000;
  background: transparent;
  border: none;
  font-size: 1.5em;
  color: #555;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.popup-close-btn:hover {
  background: rgba(0,0,0,0.1);
  color: #222;
}

/* === コンテンツ部分 === */
.popup-body {
  padding: 16px 12px;
}

/* === ロケーションタイトル === */
.popup-location-title {
  font-weight: 700;
  margin: 12px 0 6px;
  border-left: 4px solid #3498db;
  padding-left: 8px;
  color: #2c3e50;
}

/* === 各クラスブロック === */
.popup-class-block {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

/* === 時間表示 === */
.popup-time {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  padding: 6px 0;
}
.popup-time.full {
  justify-content: center;
  color: #888;
  font-weight: 600;
}

/* === 体験予約ボタン === */
.try-reserve-btn {
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.try-reserve-btn:active {
  background: #2573a7;
  transform: scale(0.96);
}



/* ================= 月ごとのカレンダー ================= */
#calendar-container.monthly {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.10);
  position: relative;
}

#calendar-container.monthly .month-wrapper {
  width: 100%;
}

#calendar-container.monthly .calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

#calendar-container.monthly .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

#calendar-container.monthly .calendar-day {
  height: 28px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
}

#calendar-container.monthly .calendar-day.sunday {
  color: #f33;
}

#calendar-container.monthly .calendar-day.saturday {
  color: #33f;
}

#calendar-container.monthly .calendar-day.holiday {
  background-color: #aca9a9;
}
/* 休日かつ土日なら文字色もグレーに上書き */
#calendar-container.monthly .calendar-day.holiday.sunday,
#calendar-container.monthly .calendar-day.holiday.saturday {
  color: #aca9a9;
}

#calendar-container.monthly .calendar-day.event {
  background-color: #e0f7ff;
}





/* ================= 年度カレンダー ================= */
#calendar-container.annual {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}


#calendar-container.annual table.month-calendar {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
#calendar-container.annual .month-title {
  background-color: #f5a623;
  color: #fff;
  font-weight: 700;
}

#calendar-container.annual th,
#calendar-container.annual td {
  border: 1px solid #ddd;
  text-align: center;
  padding: 1px;
  font-size: 0.4rem;
  user-select: none;
}

#calendar-container.annual td.holiday {
  background-color: #aca9a9;
  color: #aca9a9;
  position: relative;
}
#calendar-container.annual td.holiday::after{
    position: absolute;
    top:0;
    bottom:0;
    left: 0;
    right: 0;
    content: "休";
    color: red;
}

#calendar-container.annual td.event {
  background-color: #e0f7ff;
}

#calendar-container.annual td button {
  font-size: 0.6em;
  margin-top: 2px;
  padding: 2px 4px;
}


/* ================= PC向け調整 ================= */
@media screen and (min-width: 641px) {
#calendar-container {
  padding: 8px;
  font-size: 1em;
  background: #fff;
  position: relative;
}

  #calendar-container.monthly .calendar-day {
    height: 32px;
    line-height: 32px;
    font-size: 0.8em;
  }

  #calendar-container.annual table.month-calendar {
    font-size: 0.7em;
  }

  .lesson-popup {
    width: auto;
    min-width: 240px;
    max-height: none;
    border-radius: 8px;
  }
}