/* =====================================================
   FullCalendar Overrides — Aqua Chic Theme
   ===================================================== */

#calendar-slide-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

#calendar {
  position: relative;
  overflow: hidden;
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1.5px solid var(--border-sky);
  box-shadow: 0 4px 32px rgba(14,165,233,0.08);
  padding: 16px;
}

/* ====== TOOLBAR ====== */
.fc .fc-toolbar {
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  margin-bottom: 14px;
}

.fc .fc-toolbar-chunk:first-child {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.fc .fc-toolbar-chunk:last-child {
  flex-shrink: 0;
}

.fc .fc-toolbar-title,
.fc .fc-cal-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--sky-600);
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin: 0;
}

.fc .fc-button {
  background: #fff !important;
  border: 1.5px solid var(--sky-200) !important;
  color: var(--sky-600) !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: 'M PLUS Rounded 1c', sans-serif !important;
  padding: 5px 14px !important;
  box-shadow: none !important;
  transition: all 0.18s !important;
}

.fc .fc-button:hover {
  background: var(--sky-50) !important;
  border-color: var(--sky-400) !important;
}

.fc .fc-button:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.18) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--sky-500) !important;
  border-color: var(--sky-500) !important;
  color: #fff !important;
}

/* View switcher buttons */
.fc .fc-button-group .fc-button {
  border-radius: 0 !important;
}
.fc .fc-button-group .fc-button:first-child {
  border-radius: 999px 0 0 999px !important;
}
.fc .fc-button-group .fc-button:last-child {
  border-radius: 0 999px 999px 0 !important;
}

/* ====== DAY GRID ====== */
.fc .fc-col-header-cell-cushion {
  font-size: 12px;
  font-weight: 900;
  color: var(--text-sub);
  text-decoration: none;
  padding: 6px 4px;
}

.fc .fc-daygrid-day-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  padding: 4px 6px;
}

.fc .fc-day-today {
  background: rgba(14,165,233,0.06) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
  background: var(--sky-500);
  color: #fff;
  border-radius: 999px;
  min-width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin: 4px;
  white-space: nowrap;
}

/* 日曜日: ピンク, 土曜日: スカイ */
.fc .fc-day-sun .fc-col-header-cell-cushion,
.fc .fc-day-sun .fc-daygrid-day-number { color: #e11d74; }

.fc .fc-day-sat .fc-col-header-cell-cushion,
.fc .fc-day-sat .fc-daygrid-day-number { color: var(--sky-500); }

/* TODAY が土曜日の場合: 円バッジ内の文字を白に上書き */
.fc .fc-day-today.fc-day-sat .fc-daygrid-day-number { color: #fff; }

.fc .fc-scrollgrid {
  border: none !important;
}

.fc .fc-scrollgrid-section > * {
  border-left: none !important;
  border-right: none !important;
}

.fc td, .fc th {
  border-color: var(--border-sky) !important;
}

/* ====== EVENTS ====== */
.fc .fc-event {
  border: none !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  font-family: 'M PLUS Rounded 1c', sans-serif !important;
  padding: 1px 5px !important;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.fc .fc-event:hover {
  filter: brightness(1.08);
  transform: scale(1.02);
}

.fc .fc-event .fc-event-title,
.fc .fc-event .fc-event-title-container,
.fc .fc-event .fc-event-main,
.fc .fc-event .fc-event-main-frame {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.fc .fc-event.cat-concert {
  background: var(--color-concert) !important;
  color: #fff !important;
}

.fc .fc-event.cat-ticket {
  background: var(--color-ticket) !important;
  color: #fff !important;
}

.fc .fc-event.cat-event {
  background: var(--color-event) !important;
  color: #fff !important;
}

.fc .fc-event.cat-release {
  background: var(--color-release) !important;
  color: #fff !important;
}

.fc .fc-event.cat-media {
  background: var(--color-media) !important;
  color: #fff !important;
}

.fc .fc-event.cat-birthday {
  background: var(--color-birthday) !important;
  color: #fff !important;
}

.fc .fc-event.cat-goods {
  background: var(--color-goods) !important;
  color: #fff !important;
}

.fc .fc-event.cat-other {
  background: var(--color-other) !important;
  color: #fff !important;
}

/* ====== LIST VIEW ====== */
.fc .fc-list-event:hover td {
  background: var(--sky-50) !important;
}

.fc .fc-list-day-cushion {
  background: var(--sky-100) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  color: var(--sky-600) !important;
}

.fc .fc-list-event-title a {
  color: var(--text-main) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
}

.fc .fc-list-empty {
  background: var(--sky-50) !important;
  color: var(--text-mute) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

/* リストビュー: 白ベース（カテゴリ背景色を解除） */
.fc .fc-list-event td {
  background: #fff !important;
}

.fc .fc-list-event .fc-event-main {
  background: transparent !important;
  color: var(--text-main) !important;
  border: none !important;
  box-shadow: none !important;
}

/* graphicセル・timeセルを完全に潰す */
.fc .fc-list-event-graphic,
.fc .fc-list-event-time {
  display: none !important;
}
.fc td.fc-list-event-graphic,
.fc td.fc-list-event-time {
  width: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* タイトルセルを左端に */
.fc td.fc-list-event-title {
  padding: 8px 8px !important;
}
.fc .fc-list-event-title a {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* 日付ヘッダー: 日付＋曜日を横並びに */
.fc .fc-list-day-cushion {
  padding: 6px 8px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.fc .fc-list-day-text {
  float: none !important;
}
.fc .fc-list-day-side {
  float: none !important;
}

/* タイトル前の●ドット */
.fc .fc-list-event-title a::before {
  content: '●';
  margin-right: 6px;
  font-size: 10px;
  vertical-align: middle;
}

/* カテゴリ別ドットカラー */
.fc .fc-list-event.cat-concert  .fc-list-event-title a::before { color: var(--color-concert); }
.fc .fc-list-event.cat-ticket   .fc-list-event-title a::before { color: var(--color-ticket);  }
.fc .fc-list-event.cat-event    .fc-list-event-title a::before { color: var(--color-event);   }
.fc .fc-list-event.cat-release  .fc-list-event-title a::before { color: var(--color-release); }
.fc .fc-list-event.cat-media    .fc-list-event-title a::before { color: var(--color-media);   }
.fc .fc-list-event.cat-birthday .fc-list-event-title a::before { color: var(--color-birthday);}
.fc .fc-list-event.cat-goods    .fc-list-event-title a::before { color: var(--color-goods);   }
.fc .fc-list-event.cat-other    .fc-list-event-title a::before { color: var(--color-other);   }

/* ====== 週ビュー横スクロール（全画面サイズ共通） ====== */
.fc-timeGridWeek-view .fc-scrollgrid-section > td > .fc-scroller-harness,
.fc-timeGridWeek-view .fc-scrollgrid-section > td > .fc-scroller-harness > .fc-scroller {
  overflow-x: auto !important;
}

/* ====== TIME GRID (week / day views) ====== */
.fc .fc-timegrid-slot {
  height: 2.4em !important;
}

.fc .fc-timegrid-slot-label-cushion {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--text-sub) !important;
  padding: 0 6px !important;
}

.fc .fc-timegrid-axis-cushion {
  font-size: 11px !important;
  color: var(--text-sub) !important;
}

/* allDay 行 */
.fc .fc-timegrid-allday .fc-daygrid-day-events {
  min-height: 1.4em;
}

/* イベントブロック（timeGrid） */
.fc .fc-timegrid-event .fc-event-main {
  padding: 2px 5px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

.fc .fc-timegrid-event {
  border-radius: 6px !important;
  border: none !important;
}

/* 現在時刻インジケーター */
.fc .fc-timegrid-now-indicator-line {
  border-color: #e11d74 !important;
  border-width: 2px !important;
}

.fc .fc-timegrid-now-indicator-arrow {
  border-top-color: #e11d74 !important;
  border-bottom-color: #e11d74 !important;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 600px) {
  #calendar { padding: 10px 6px; border-radius: 14px; }
  .fc .fc-toolbar { flex-wrap: wrap; gap: 6px; }
  .fc .fc-toolbar-title { font-size: 15px; }
  .fc .fc-button { padding: 4px 8px !important; font-size: 10px !important; }
  .fc .fc-event { font-size: 10px !important; }

  /* 週ビュー: モバイルで横スクロール */
  .fc-timeGridWeek-view {
    overflow-x: auto;
  }

  /* 週ビュー: 各日の列を最低幅を確保して押しつぶし防止 */
  .fc-timeGridWeek-view .fc-col-header-cell,
  .fc-timeGridWeek-view .fc-timegrid-col {
    min-width: 44px !important;
  }

  /* 週ビューのヘッダー */
  .fc-timeGridWeek-view .fc-col-header-cell-cushion {
    font-size: 11px !important;
    padding: 2px 1px !important;
  }

  /* 日ビュー: 時間ラベルを少し小さく */
  .fc .fc-timegrid-slot-label-cushion {
    font-size: 10px !important;
  }
}

/* ====== SWIPE SLIDE ANIMATION ====== */

/*
 * ゴーストは #calendar 内に absolute で配置。
 * #calendar の overflow:hidden でクリップされる。
 * .fc-view-harness をターゲットにスライドアニメーションを適用。
 */

#calendar-slide-ghost {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  will-change: transform;
  overflow: hidden;
  background: var(--surface-card);
}

#calendar-slide-ghost.ghost-exit-left {
  animation: ghostExitLeft 350ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#calendar-slide-ghost.ghost-exit-right {
  animation: ghostExitRight 350ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fc-view-harness.slide-enter-from-right {
  animation: enterFromRight 350ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fc-view-harness.slide-enter-from-left {
  animation: enterFromLeft 350ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ghostExitLeft  { from { transform: translateX(0); }     to { transform: translateX(-110%); } }
@keyframes ghostExitRight { from { transform: translateX(0); }     to { transform: translateX(110%);  } }
@keyframes enterFromRight { from { transform: translateX(110%); }  to { transform: translateX(0); }    }
@keyframes enterFromLeft  { from { transform: translateX(-110%); } to { transform: translateX(0); }    }

@media (prefers-reduced-motion: reduce) {
  #calendar-slide-ghost.ghost-exit-left,
  #calendar-slide-ghost.ghost-exit-right,
  .fc-view-harness.slide-enter-from-right,
  .fc-view-harness.slide-enter-from-left {
    animation: none !important;
  }
}
