/**
 * Booking Section Layout - Clean Redesign
 * 
 * This file provides a clean, modern layout for the booking section
 * Replaces the problematic grid layout from styles.css
 */

/* ========================================
   Booking Container Layout
   ======================================== */

.booking-container {
  display: grid !important;
  grid-template-columns: 1.6fr 1.4fr !important; /* 左側略收窄，右側預約摘要變寬 */
  gap: 2rem !important;
  margin-top: 3rem !important;
  align-items: start !important; /* 確保頂部對齊 */
}

/* Left column: Date and Time slots (stacked vertically) */
.booking-container > .booking-card:nth-child(1),
.booking-container > .booking-card:nth-child(2) {
  grid-column: 1 / 2 !important; /* 左側欄位 */
  grid-row: auto !important; /* 垂直堆疊 */
}

/* Right column: Booking summary (spans full height) */
.booking-container > .booking-card.booking-summary {
  grid-column: 2 / 3 !important; /* 右側欄位 */
  grid-row: 1 / 3 !important; /* 跨越兩行 */
  align-self: start !important; /* 頂部對齊 */
}

/* ========================================
   Booking Cards - Base Styles
   ======================================== */

.booking-card {
  background: #f8f9fa !important;
  padding: 2rem !important;
  border-radius: 20px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s ease !important;
}

.booking-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* ========================================
   Booking Summary - Modern Card Design
   ======================================== */

.booking-summary {
  background: white !important;
  border: 2px solid #e9ecef !important;
  position: relative !important; /* 改為 relative 以對齊頂部 */
  top: 0 !important; /* 移除 top 偏移 */
  max-height: none !important; /* 移除最大高度限制 */
  overflow-y: visible !important; /* 移除內部滾動 */
}

/* Scrollbar styling for booking summary */
.booking-summary::-webkit-scrollbar {
  width: 6px;
}

.booking-summary::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.booking-summary::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.booking-summary::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ========================================
   Card Titles and Subtitles
   ======================================== */

.booking-card .card-title {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  margin-bottom: 1rem !important;
  color: #1a1a1a !important;
}

.booking-card .card-subtitle {
  font-size: 0.875rem !important;
  color: #666 !important;
  margin-bottom: 1.5rem !important;
  opacity: 1 !important;
}

/* ========================================
   Summary Content Styling
   ======================================== */

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.summary-label {
  font-size: 0.9rem;
  color: #666 !important;
  font-weight: 500;
}

.summary-value {
  font-size: 0.95rem;
  color: #1a1a1a !important;
  font-weight: 600;
  text-align: right;
}

.summary-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 1rem 0;
}

/* ========================================
   Price Breakdown
   ======================================== */

.summary-breakdown {
  margin: 1rem 0;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.price-label {
  color: #666 !important;
}

.price-value {
  color: #1a1a1a !important;
  font-weight: 600;
}

/* Total price highlight */
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-top: 1rem;
  border-top: 2px solid #e0e0e0;
  font-size: 1.1rem;
  font-weight: 700;
}

.summary-total .summary-label {
  color: #1a1a1a !important;
  font-size: 1.1rem;
}

.summary-total .summary-value {
  color: #FC3130 !important;
  font-size: 1.5rem;
}

/* ========================================
   Proceed Button
   ======================================== */

.proceed-booking-btn,
#proceedBookingBtn {
  width: 100% !important;
  padding: 1rem 2rem !important;
  margin-top: 1.5rem !important;
  background: linear-gradient(135deg, #FC3130 0%, #B43228 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 12px rgba(252, 49, 48, 0.3) !important;
}

.proceed-booking-btn:hover,
#proceedBookingBtn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(252, 49, 48, 0.4) !important;
}

.proceed-booking-btn:active,
#proceedBookingBtn:active {
  transform: translateY(0) !important;
}

.proceed-booking-btn:disabled,
#proceedBookingBtn:disabled {
  background: #ccc !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
  .booking-container {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  .booking-container > .booking-card:nth-child(1),
  .booking-container > .booking-card:nth-child(2),
  .booking-container > .booking-card.booking-summary {
    grid-column: 1 / 2 !important;
    grid-row: auto !important;
  }
  
  .booking-summary {
    position: relative !important;
    top: 0 !important;
    max-height: none !important;
    margin-top: 1rem !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .booking-card {
    padding: 1.5rem !important;
    border-radius: 16px !important;
  }
  
  .booking-card .card-title {
    font-size: 1.25rem !important;
  }
  
  .booking-card .card-subtitle {
    font-size: 0.8rem !important;
  }
  
  .summary-row {
    padding: 0.6rem 0;
  }
  
  .summary-label,
  .summary-value {
    font-size: 0.85rem !important;
  }
  
  .summary-total .summary-label {
    font-size: 1rem !important;
  }
  
  .summary-total .summary-value {
    font-size: 1.25rem !important;
  }
  
  .proceed-booking-btn,
  #proceedBookingBtn {
    padding: 0.875rem 1.5rem !important;
    font-size: 0.95rem !important;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .booking-container {
    gap: 1rem !important;
    margin-top: 2rem !important;
  }
  
  .booking-card {
    padding: 1.25rem !important;
    border-radius: 12px !important;
  }
  
  /* DISABLED: 改為單行顯示 */
  /* .summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  } */
  
  /* 單行顯示 */
  .summary-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  
  .summary-value {
    text-align: left !important;
  }
}

/* ========================================
   Empty State
   ======================================== */

.empty-summary {
  text-align: center;
  padding: 3rem 1rem;
  color: #999 !important;
}

.empty-summary-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-summary-text {
  font-size: 0.9rem;
  color: #999 !important;
}

/* ========================================
   Loading State
   ======================================== */

.loading-summary {
  text-align: center;
  padding: 2rem 1rem;
  color: #666 !important;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #FC3130;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

