/* ==========================================================================
   KDD 2026 Jeju Island Excursion - Custom Styles
   Theme: Jeju Ocean (ocean blue + emerald accent)
   ========================================================================== */

/* Design Tokens */
:root {
  /* Brand */
  --c-primary: #0284c7;        /* ocean blue */
  --c-primary-strong: #0369a1;
  --c-primary-soft: #e0f2fe;
  --c-primary-tint: #f0f9ff;
  --c-accent: #059669;         /* emerald — 무료/예약가능 강조 */
  --c-accent-soft: #ecfdf5;

  /* Neutral */
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-text: #1e293b;
  --c-muted: #64748b;
  --c-border: #e2e8f0;

  /* Shape & depth */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
  --ring: 0 0 0 3px rgba(2, 132, 199, 0.18);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

/* Refresh: 부드러운 폼 포커스 링 (일관된 primary 톤) */
input:focus, select:focus, textarea:focus {
  box-shadow: var(--ring);
  border-color: var(--c-primary) !important;
  outline: none;
}

/* Refresh: 카드 hover lift (코스 카드/요약 박스) */
.course-card {
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.course-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* Refresh: Book Now 활성 버튼 톤 통일 */
#submit-reservation:not(:disabled) {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(2, 132, 199, 0.5);
  transition: background var(--transition), transform var(--transition);
}
#submit-reservation:not(:disabled):hover {
  background: var(--c-primary-strong);
  transform: translateY(-1px);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Navigation Tabs */
.nav-tab {
  color: #64748b;
  background: transparent;
}

.nav-tab:hover {
  color: #0ea5e9;
  background: #f0f9ff;
}

.nav-tab.active {
  color: #0369a1;
  background: #e0f2fe;
}

.nav-tab-mobile {
  color: #64748b;
  background: transparent;
}

.nav-tab-mobile:hover {
  color: #0ea5e9;
  background: #f0f9ff;
}

.nav-tab-mobile.active {
  color: #0369a1;
  background: #e0f2fe;
}

/* Course Tabs */
.course-tab {
  border-color: #e2e8f0;
  background: white;
}

.course-tab:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.course-tab.active {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  box-shadow: 0 4px 20px -4px rgba(14, 165, 233, 0.15);
}

/* Bottom Navigation Container */
.course-bottom-nav,
.main-bottom-nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 20px -5px rgba(0, 0, 0, 0.08);
}

/* Bottom Navigation Scrollable Container */
.course-bottom-nav > div {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Bottom Navigation Buttons - Consistent Style */
.bottom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* 코스 네비게이션 탭 - 배지만 표시 */
.course-nav-tab {
  padding: 0.5rem;
  min-width: auto;
}

.bottom-btn.primary {
  background: #0ea5e9;
  color: white;
  box-shadow: 0 2px 8px -2px rgba(14, 165, 233, 0.4);
}

.bottom-btn.primary:hover {
  background: #0284c7;
}

.bottom-btn.secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.bottom-btn.secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.bottom-btn.course {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.bottom-btn.course:hover {
  background: #e2e8f0;
}

.bottom-btn.course.active,
.bottom-btn.secondary.active {
  background: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
  box-shadow: 0 2px 8px -2px rgba(14, 165, 233, 0.4);
}

.course-nav-tab.active {
  background: #0ea5e9;
  color: white;
  border-color: #0ea5e9;
  box-shadow: 0 2px 8px -2px rgba(14, 165, 233, 0.4);
}

/* Course badge inside button */
.course-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  color: white;
}

.course-badge.east {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.course-badge.west {
  background: linear-gradient(135deg, #f97316, #ef4444);
}

/* Legacy course nav tab styles - keep for compatibility */
.course-nav-tab {
  color: #64748b;
  background: #f1f5f9;
  border-color: transparent;
}

/* Course Card in Reservation Page */
.course-card {
  cursor: pointer;
  transition: all 0.25s ease;
}

.course-card:hover {
  border-color: #94a3b8;
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
}

.course-card.selected {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.03);
}

.course-card.selected:hover {
  border-color: #0ea5e9;
}

/* Date Badge */
.date-badge {
  cursor: pointer;
}

.date-badge:hover {
  transform: translateY(-1px);
}

/* Calendar Modal */
.calendar-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.calendar-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.calendar-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 101;
  width: calc(100% - 2rem);
  max-width: 340px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

/* PC에서 달력 더 크게 */
@media (min-width: 640px) {
  .calendar-modal {
    max-width: 420px;
  }
}

.calendar-modal-backdrop.show .calendar-modal {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Calendar Styles */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.calendar-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 1.125rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0;
}

/* Timeline view: override grid layout to use full width */
.calendar-grid:has(.timeline-calendar-container) {
  display: block;
  width: 100%;
  padding: 0;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.5rem 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: default;
  position: relative;
  transition: all 0.2s ease;
  min-width: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.available {
  color: #1e293b;
  cursor: pointer;
  border: 2px solid #f97316;
  background: white;
}

.calendar-day.available:hover {
  background: #fff7ed;
}

.calendar-day.available::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  background: #f97316;
  border-radius: 50%;
}

.calendar-day.selected {
  background: #f97316;
  color: white;
  border-color: #f97316;
}

.calendar-day.selected::after {
  background: white;
}

.calendar-day.disabled {
  color: #94a3b8;
  background: #f1f5f9;
}

.calendar-day .course-label {
  font-size: 0.5625rem;
  color: #94a3b8;
  margin-top: 1px;
  text-transform: capitalize;
}

.calendar-day.available .course-label {
  color: #f97316;
}

.calendar-day.selected .course-label {
  color: white;
}

/* Timeline Calendar View (v2) */
.calendar-grid:has(.timeline-calendar-container) {
  display: block;
  width: 100%;
  padding: 0;
}

.timeline-calendar-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  justify-content: flex-start;
  width: 100%;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}


.timeline-month-divider {
  width: 1px;
  height: 100%;
  background: #e2e8f0;
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.timeline-date-item {
  flex: 0 0 auto;
  width: 55px;
  min-width: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem 0.25rem;
  border-radius: 0.5rem;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  transition: all 0.2s ease;
  cursor: default;
  position: relative;
}

.timeline-date-item.available {
  border-color: #f97316;
  background: white;
  cursor: pointer;
}

.timeline-date-item.available::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  background: #f97316;
  border-radius: 50%;
}

.timeline-date-item.available:hover {
  background: #fff7ed;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.timeline-date-item.disabled {
  border-color: #cbd5e1;
  background: #f1f5f9;
  opacity: 0.6;
}

.timeline-date-item.unavailable {
  border-color: #e2e8f0;
  background: #f8fafc;
  opacity: 0.5;
}

.timeline-date-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  margin-bottom: 0.25rem;
}

.timeline-month {
  font-size: 0.625rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-day {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.timeline-date-item.available .timeline-day {
  color: #f97316;
}

.timeline-date-item.disabled .timeline-day,
.timeline-date-item.unavailable .timeline-day {
  color: #94a3b8;
}

.timeline-weekday {
  font-size: 0.625rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.timeline-label {
  font-size: 0.5rem;
  font-weight: 600;
  color: #f97316;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.125rem;
  min-height: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-date-item.disabled .timeline-label,
.timeline-date-item.unavailable .timeline-label {
  color: transparent;
}

@media (max-width: 640px) {
  .timeline-date-item {
    width: 55px;
    min-width: 55px;
    padding: 0.5rem 0.25rem;
  }
  
  .timeline-day {
    font-size: 1rem;
  }
  
  .timeline-month {
    font-size: 0.5rem;
  }
  
  .timeline-weekday {
    font-size: 0.5rem;
  }
  
  .timeline-label {
    font-size: 0.4375rem;
  }
}

.calendar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}

.calendar-close-btn {
  padding: 0.625rem 1.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-close-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: white;
  border: 2px solid #f97316;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #f97316;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.9375rem;
}

.toast-message {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.125rem;
}

/* Summary Selected Course Box */
.summary-course-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #0ea5e9;
  border-radius: 0.75rem;
  position: relative;
}

.summary-course-box .course-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.summary-course-box .course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-course-box .course-info {
  flex: 1;
  min-width: 0;
}

.summary-course-box .course-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.875rem;
}

.summary-course-box .course-date {
  font-size: 0.75rem;
  color: #0ea5e9;
  margin-top: 0.125rem;
}

.summary-course-box .remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.summary-course-box .remove-btn:hover {
  background: #f87171;
  color: white;
}

.summary-course-box .remove-btn svg {
  width: 0.75rem;
  height: 0.75rem;
}

/* Course Card Remove Button (Left side course selection) */
.course-remove-btn {
  cursor: pointer;
  border: none;
  outline: none;
  min-width: 1.5rem;
  min-height: 1.5rem;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.course-remove-btn:focus {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.course-remove-btn svg {
  pointer-events: none;
  width: 1rem;
  height: 1rem;
  stroke-width: 2.5;
}

/* Hide scrollbar but keep scrolling */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Mobile Bottom Navigation - active state handled by .bottom-btn.secondary.active */

/* Course Radio Buttons (Reservation Form) */
.course-radio {
  cursor: pointer;
  transition: all 0.2s ease;
}

.course-radio:hover {
  border-color: #94a3b8;
}

.course-radio.selected {
  border-color: #0ea5e9;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.course-radio.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spot Cards */
.spot-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.spot-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.spot-card:hover .spot-image {
  transform: scale(1.05);
}

.spot-image {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reservation Cards */
.reservation-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.reservation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
  border-color: #0ea5e9;
}

/* Modal Animations */
#detail-modal,
#success-modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#detail-modal.show,
#success-modal.show {
  opacity: 1;
  visibility: visible;
}

#detail-modal > div:last-child > div,
#success-modal > div:last-child > div {
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#detail-modal.show > div:last-child > div,
#success-modal.show > div:last-child > div {
  transform: scale(1) translateY(0);
}

/* Form Input Focus States */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Course Overview Card */
.course-overview {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.confirmed {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
}

.status-badge.pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.status-badge.cancelled {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

/* Detail Row */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.detail-value {
  font-size: 0.875rem;
  color: #1e293b;
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* Timeline Item Animation */
.timeline-item {
  opacity: 0;
  transform: translateX(-10px);
  animation: timelineItemFadeIn 0.5s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }
.timeline-item:nth-child(6) { animation-delay: 0.3s; }
.timeline-item:nth-child(7) { animation-delay: 0.35s; }
.timeline-item:nth-child(8) { animation-delay: 0.4s; }

@keyframes timelineItemFadeIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Timeline icon hover effect */
.timeline-item:hover > div:first-child > div:first-child {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Staggered Fade In */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* Card Number Input Formatting */
#card-number {
  letter-spacing: 0.15em;
}

/* Responsive Typography */
@media (max-width: 640px) {
  h2 {
    font-size: 1.75rem;
  }
}

/* Print Styles */
@media print {
  .nav-tab,
  .nav-tab-mobile,
  button[type="submit"],
  footer {
    display: none;
  }
  
  .page-content {
    display: block !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .nav-tab.active {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }
  
  input:focus,
  select:focus,
  textarea:focus {
    outline: 3px solid #0369a1;
    outline-offset: 2px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Dark Mode Ready (optional future enhancement) */
@media (prefers-color-scheme: dark) {
  /* Can be enabled if needed */
}

/* Book Now Button - Enabled State */
#submit-reservation:not(:disabled) {
  background: #0ea5e9 !important;
  color: white !important;
  cursor: pointer !important;
  box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.25) !important;
}

#submit-reservation:not(:disabled):hover {
  background: #0284c7 !important;
}

/* ==========================================================================
   [CHANGED] View Transitions API - 페이지 전환 애니메이션
   ========================================================================== */

/* View Transitions 기본 설정 */
@view-transition {
  navigation: auto;
}

/* 페이지 전환 시 fade 애니메이션 */
::view-transition-old(root) {
  animation: fade-out 0.2s ease-out forwards;
}

::view-transition-new(root) {
  animation: fade-in 0.3s ease-in forwards;
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 부드러운 슬라이드 효과 (선택적) */
::view-transition-old(root) {
  animation: slide-out 0.25s ease-out forwards;
}

::view-transition-new(root) {
  animation: slide-in 0.25s ease-out forwards;
}

@keyframes slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* View Transition을 지원하지 않는 브라우저를 위한 폴백 */
@supports not (view-transition-name: root) {
  .page-content {
    animation: fadeIn 0.3s ease forwards;
  }
}

/* ==========================================================================
   Course Product Grid (메인 상품 리스트)
   ========================================================================== */
.course-product-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.course-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.course-product-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  overflow: hidden;
}
.course-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.course-product-card:hover .course-product-thumb img {
  transform: scale(1.06);
}
.course-product-badge {
  display: none;
  position: absolute;
  top: 12px;
  left: 12px;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.course-product-price {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.course-product-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.course-product-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 코스 코드 컬러 동그라미 배지 */
.course-code-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.course-code-dot--sm {
  width: 24px;
  height: 24px;
  font-size: 0.68rem;
}
.course-product-sub {
  font-size: 0.8rem;
  color: var(--c-muted);
  line-height: 1.4;
}
.course-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.course-product-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--c-primary-tint);
  color: var(--c-primary-strong);
  font-size: 0.72rem;
  font-weight: 600;
}
.course-product-tag svg { width: 13px; height: 13px; }
.course-product-spots {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
}
.course-product-cta {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-primary);
}

/* ==========================================================================
   Course Detail Modal
   ========================================================================== */
.course-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.course-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}
.course-modal {
  position: relative;
  background: var(--c-surface);
  border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition);
}
.course-modal-backdrop.show .course-modal {
  transform: translateY(0) scale(1);
}
.course-modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition);
}
.course-modal-close:hover { background: #fff; color: #0f172a; }

#course-modal-body {
  overflow-y: auto;
}
.modal-hero {
  padding: 16px 20px 14px;
  color: #fff;
  border-radius: var(--radius-lg) 0 0 0;
}
.modal-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.modal-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.modal-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.82rem;
  font-weight: 700;
}
.modal-hero h3 { font-size: 1.3rem; font-weight: 700; line-height: 1.25; }
.modal-hero p { font-size: 0.88rem; opacity: 0.9; margin-top: 2px; }

.modal-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--c-border);
  border-bottom: 1px solid var(--c-border);
}
.modal-info-item {
  background: var(--c-surface);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modal-info-label { font-size: 0.7rem; color: var(--c-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.modal-info-value { font-size: 0.88rem; color: var(--c-text); font-weight: 600; }
.modal-info-price { color: var(--c-accent); }

.modal-desc {
  padding: 18px 24px 4px;
  color: #475569;
  line-height: 1.7;
  font-size: 0.9rem;
}
.modal-spots { padding: 18px 24px 8px; }
.modal-spots > h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 14px;
}
.modal-spot {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.modal-spot:last-child { border-bottom: none; margin-bottom: 0; }

/* 픽업/드랍 마커 (관광지와 구분) — 아이콘 영역을 사진(96px) 폭에 맞춰 텍스트 정렬 일치 */
.modal-spot--transit { align-items: center; }
.modal-spot-icon {
  width: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-spot-icon svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  box-sizing: border-box;
  border-radius: 9999px;
  background: var(--c-primary-soft);
  color: var(--c-primary-strong);
}
.modal-spot-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-primary);
  margin-left: 4px;
}
.modal-spot-img {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #e2e8f0;
}
.modal-spot-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-spot-text h5 { font-size: 0.95rem; font-weight: 700; color: var(--c-text); }
.modal-spot-kr { font-size: 0.75rem; color: var(--c-muted); margin-top: 1px; }
.modal-spot-desc { font-size: 0.82rem; color: #475569; line-height: 1.6; margin-top: 6px; }

.course-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--c-border);
}
.course-modal-book {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: var(--c-primary);
  color: #fff;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
}
.course-modal-book:hover { background: var(--c-primary-strong); transform: translateY(-1px); }

@media (max-width: 480px) {
  .modal-hero h3 { font-size: 1.2rem; }
  .modal-spot-img { width: 72px; height: 72px; }
  .modal-spot-icon { width: 72px; }
}

