/* =====================================================
   jQuery UI Datepicker — フロント＆管理画面 共通スタイル
   スマホでも崩れないよう完全にスタイルを上書きする
   ===================================================== */

/* ── ポップアップ本体 ── */
.ui-datepicker {
  display: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  padding: 12px;
  width: 320px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 14px;
  z-index: 9999 !important;
}

/* ── ヘッダー（年月 + 前後ボタン） ── */
.ui-datepicker-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 40px 12px;
  border-bottom: 1px solid #f0f2f5;
  margin-bottom: 8px;
}

.ui-datepicker-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  line-height: 1.3;
}

.ui-datepicker-prev,
.ui-datepicker-next {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  width: 36px;
  height: 36px;
  border: 1.5px solid #e0e3ec;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background .15s;
}
.ui-datepicker-prev { left: 0; }
.ui-datepicker-next { right: 0; }
.ui-datepicker-prev:hover,
.ui-datepicker-next:hover { background: #f3f4f6; }

/* jQuery UI がデフォルトで入れる span テキストを非表示にして矢印に置き換え */
.ui-datepicker-prev span,
.ui-datepicker-next span { display: none !important; }
.ui-datepicker-prev::before { content: "‹"; font-size: 20px; color: #374151; line-height: 1; }
.ui-datepicker-next::before { content: "›"; font-size: 20px; color: #374151; line-height: 1; }

/* ── カレンダーテーブル ── */
.ui-datepicker-calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ui-datepicker-calendar thead th {
  padding: 4px 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* 曜日ヘッダー：日→赤、土→青 */
.ui-datepicker-calendar thead th:first-child { color: #ef4444; }
.ui-datepicker-calendar thead th:last-child  { color: #3b82f6; }

.ui-datepicker-calendar tbody td {
  padding: 2px;
  text-align: center;
  border: none;
}

.ui-datepicker-calendar tbody td a,
.ui-datepicker-calendar tbody td span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
  box-sizing: border-box;
}

.ui-datepicker-calendar tbody td a:hover {
  background: #f0fdf4;
  color: #1a1a2e;
}

/* 選択済みの日 */
.ui-datepicker-calendar tbody td.ui-datepicker-current-day a,
.ui-datepicker-calendar tbody td .ui-state-active {
  background: #06c755 !important;
  color: #fff !important;
  font-weight: 700 !important;
}

/* 今日 */
.ui-datepicker-calendar tbody td.ui-datepicker-today a {
  background: #f0fdf4;
  color: #06c755;
  font-weight: 700;
}

/* 撮影不可日 */
.tls-blocked-day a, .tls-blocked-day span {
  color: #d1d5db !important;
  text-decoration: line-through !important;
  cursor: default !important;
  pointer-events: none !important;
}

/* 日曜・祝日 → 赤 */
.ui-datepicker-calendar tbody td.tls-day-sun a,
.ui-datepicker-calendar tbody td.tls-day-sun span {
  color: #ef4444 !important;
  font-weight: 600;
}
.ui-datepicker-calendar tbody td.tls-day-sun a:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
}

/* 土曜 → 青 */
.ui-datepicker-calendar tbody td.tls-day-sat a,
.ui-datepicker-calendar tbody td.tls-day-sat span {
  color: #3b82f6 !important;
  font-weight: 600;
}
.ui-datepicker-calendar tbody td.tls-day-sat a:hover {
  background: #eff6ff !important;
  color: #2563eb !important;
}

/* 選択済み（グリーン）は土日色より優先 */
.ui-datepicker-calendar tbody td.ui-datepicker-current-day a,
.ui-datepicker-calendar tbody td .ui-state-active {
  background: #06c755 !important;
  color: #fff !important;
  font-weight: 700 !important;
}

/* 他の月の日 */
.ui-datepicker-calendar tbody td.ui-datepicker-other-month a,
.ui-datepicker-calendar tbody td.ui-datepicker-other-month span {
  color: #d1d5db;
}

/* ── select（年月プルダウン） ── */
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
  width: auto;
  font-size: 14px;
  padding: 2px 4px;
  border: 1px solid #e0e3ec;
  border-radius: 6px;
}

/* ── スマホ対応：タップターゲットを大きく ── */
@media (max-width: 600px) {
  .ui-datepicker {
    width: calc(100vw - 24px);
    padding: 10px;
  }
  .ui-datepicker-calendar tbody td a,
  .ui-datepicker-calendar tbody td span {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
}
