/* 예약 상세 페이지 스타일 */

/* 메인 컨테이너 - sticky가 작동하도록 overflow 설정 */
.program-detail-container {
  background-color: #fff;
  overflow: visible !important;
}

/* sticky가 작동하도록 부모 요소에서 overflow 제거 */
.program-detail-container {
  overflow: visible !important;
}

/* 상세 설명 영역 스타일 오버라이드 */
.program-description-content {
  font-size: 0.95rem;
  /* 기본 폰트 크기 약간 축소 */
  line-height: 1.6;
}

.program-description-content p {
  margin-bottom: 1em;
  font-size: 1rem;
}

.program-description-content h1 {
  font-size: 1.5rem !important;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
}

.program-description-content h2 {
  font-size: 1.3rem !important;
  font-weight: 600;
  margin-top: 1.4em;
  margin-bottom: 0.8em;
}

.program-description-content h3 {
  font-size: 1.1rem !important;
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

.program-description-content ul,
.program-description-content ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
  list-style-type: disc;
}

.program-description-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1em 0;
}

/* 예약 이미지 캐러셀 */
.reservation-image-carousel .splide__slide {
  aspect-ratio: 4 / 3;
}

.reservation-image-carousel .splide__slide img {
  border-radius: 0.75rem;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.reservation-image-carousel .splide__pagination {
  bottom: 0.75rem;
}

.reservation-image-carousel--static .splide__list {
  display: grid;
  gap: 0.75rem;
}

.reservation-image-carousel.splide:not(.is-initialized) .splide__list {
  display: flex;
  overflow-x: auto;
}

.reservation-image-carousel.splide:not(.is-initialized) .splide__slide {
  flex: 0 0 100%;
}

@media (min-width: 768px) {
  .reservation-image-carousel--static .splide__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reservation-image-carousel.splide:not(.is-initialized) .splide__slide {
    flex-basis: 50%;
  }
}

/* 달력 스타일 (feverup 컨셉) */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 월 선택 탭 */
.month-tab-btn {
  white-space: nowrap;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  color: #374151;
  background-color: #fff;
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  .month-tab-btn {
    min-height: 0;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
  }
}

.month-tab-btn.active {
  background-color: #0f172a;
  color: #fff;
  border-color: #0f172a;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 우측 컬럼 sticky 설정 - 투명한 배경과 테두리로 깔끔하게 표현 */
.program-info-column {
  position: relative;
}

/* 낮은 데스크톱 화면에서도 달력과 신청 버튼이 한 화면에 유지되도록 압축 */
@media (min-width: 1024px) and (max-height: 850px) {
  .program-info-column .pb-4.mb-6 {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .program-info-column h1 {
    font-size: 1.25rem;
  }

  .program-info-column #month-tabs-container,
  .program-info-column #reservation-calendar {
    margin-bottom: 0.5rem;
  }

  .program-info-column #reservation-calendar {
    padding: 0.5rem;
  }

  .program-info-column .calendar-day {
    aspect-ratio: auto;
    height: clamp(1.5rem, 3.5vh, 2.25rem);
    border-radius: 0.5rem;
  }

  .program-info-column #selected-day-sessions-container {
    margin-bottom: 0.75rem;
  }

  .program-info-column #selected-day-sessions-container h4 {
    margin-bottom: 0.5rem;
  }

  .program-info-column .schedule-select-btn {
    padding: 0.75rem;
  }

  .program-info-column .border-t.my-6 {
    margin-bottom: 0.75rem;
    margin-top: 0.75rem;
  }

  .program-info-column .selected-info-summary > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.5rem;
  }

  .program-info-column #apply-action-area {
    margin-top: 1rem;
  }
}

/* 달력 컴팩트 스타일 */
/* 달력 컴팩트 스타일 */
/* 달력 날짜 셀 기본 스타일 */
.calendar-day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 0.75rem; /* 더 부드러운 라운딩 */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 2px solid transparent;
  background-color: transparent;
}

.day-number {
  font-size: 0.95rem;
  font-weight: 500;
  color: #94a3b8; /* 기본: 연한 회색 (일정 없는 날) */
}

/* 일정이 있는 날짜 공통 */
.calendar-day.has-schedule .day-number {
  color: #0f172a;
  font-weight: 700;
}

/* 상태별 배경색 (Feverup 스타일) */
.calendar-day.day-recruiting {
  background-color: #eff6ff; /* 모집중: 아주 연한 파랑 */
}

.calendar-day.day-scheduled {
  background-color: #f5f3ff; /* 오픈예정: 아주 연한 보라 */
}

.calendar-day.day-closed {
  background-color: #f8fafc; /* 마감: 아주 연한 회색 */
}

/* 호버 효과 */
.calendar-day.has-schedule:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}

/* 선택된 날짜 강조 (확 티가 나게) */
.calendar-day.selected {
  border-color: #3b82f6 !important;
  background-color: #fff !important;
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
  z-index: 10;
}

.calendar-day.selected .day-number {
  color: #3b82f6 !important;
  font-weight: 800;
  font-size: 1.05rem;
}

/* 비활성 날짜 (이번 달이 아니거나 이전 날짜 등) */
.calendar-day:not(.has-schedule) {
  cursor: default;
  opacity: 0.4;
}

/* 오늘 날짜 표시 */
.calendar-day.today:not(.selected) {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  text-decoration-color: #3b82f6;
}

/* 요약 정보 섹션 애니메이션 */
.selected-info-summary {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 세션 선택 리스트 클리핑 방지 패딩 추가 */
#session-list {
  padding: 6px 4px;
}

/* 세션 선택 버튼 애니메이션 */
.schedule-select-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.schedule-select-btn.selected {
  border-color: #3b82f6 !important;
  background-color: #eff6ff !important;
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.15);
}

.schedule-select-btn:active {
  transform: scale(0.98);
}

/* --------------------------------------------------
   모바일 최적화 (Mobile Optimization)
   -------------------------------------------------- */
@media (max-width: 1024px) {
  /* 하단 고정 버튼 공간 확보를 위한 여백 (JS가 활성화될 때 유동적으로 필요할 수 있음) */
  .program-detail-container {
    padding-bottom: 2rem;
  }

  /* 신청하기 버튼 영역 기본 상태 */
  .apply-action-area {
    margin-top: 2rem;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* 스크롤 후 하단 고정 상태 (JS에서 추가됨) */
  .apply-action-area.is-stuck {
    position: fixed;
    bottom: 4rem;
    left: 0;
    right: 0;
    margin: 0;
    padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1000;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  /* 버튼 스타일 최적화 */
  .apply-action-area button,
  .apply-action-area a {
    margin-top: 0 !important;
    height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  }

  .apply-action-area p {
    margin-top: 0.75rem !important;
    margin-bottom: 0 !important;
  }

  /* 지도 영역 최하단 배치 보정 */
  #detail-map-container {
    margin-top: 3rem;
    margin-bottom: 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .apply-action-area.is-stuck {
    bottom: 0;
  }
}
