/**
 * date-timeslot-enhancements.css
 * 日期和時段選擇器的增強功能樣式
 * 
 * 包含：
 * - 日期展開/收起功能
 * - 下一步按鈕
 * - 移動端優化
 */

/* ========== 日期選擇器增強 ========== */

/* 隱藏的日期按鈕（移動端） */
.date-btn.date-hidden {
  display: none;
}

/* 展開/收起按鈕 */
.date-expand-btn {
  width: 100%;
  padding: 12px 20px;
  margin-top: 16px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.date-expand-btn:hover {
  background: #eeeeee;
  border-color: #d0d0d0;
  color: #333;
}

.date-expand-btn .expand-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.date-expand-btn .expand-icon.expanded {
  transform: rotate(180deg);
}

/* 日期選擇器下一步按鈕容器 */
.date-next-step-container {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: center;
}

/* 日期選擇器下一步按鈕 */
.date-next-step-btn {
  min-width: 200px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.date-next-step-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.date-next-step-btn svg {
  transform: rotate(90deg);
  transition: transform 0.3s ease;
}

.date-next-step-btn:hover svg {
  transform: rotate(90deg) translateX(3px);
}

/* ========== 時段選擇器增強 ========== */

/* 時段選擇器下一步按鈕容器 */
.timeslot-next-step-container {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: center;
}

/* 時段選擇器下一步按鈕 */
.timeslot-next-step-btn {
  min-width: 200px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.timeslot-next-step-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.timeslot-next-step-btn svg {
  transform: rotate(90deg);
  transition: transform 0.3s ease;
}

.timeslot-next-step-btn:hover svg {
  transform: rotate(90deg) translateX(3px);
}

/* ========== 移動端優化 ========== */

@media (max-width: 768px) {
  /* 日期展開按鈕在移動端更明顯 */
  .date-expand-btn {
    padding: 14px 20px;
    font-size: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f0f0 100%);
  }
  
  /* 下一步按鈕在移動端佔滿寬度 */
  .date-next-step-container,
  .timeslot-next-step-container {
    padding: 16px 0;
  }
  
  .date-next-step-btn,
  .timeslot-next-step-btn {
    width: 100%;
    min-width: auto;
    padding: 16px 24px;
    font-size: 17px;
  }
}

/* ========== 動畫效果 ========== */

/* 日期按鈕展開/收起動畫 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.date-btn:not(.date-hidden) {
  animation: fadeIn 0.3s ease forwards;
}

/* 下一步按鈕出現動畫 */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.date-next-step-container,
.timeslot-next-step-container {
  animation: slideUp 0.4s ease forwards;
}

/* ========== 桌面端優化 ========== */

@media (min-width: 769px) {
  /* 桌面端不顯示展開按鈕 */
  .date-expand-btn {
    display: none;
  }
  
  /* 桌面端下一步按鈕居中但不佔滿寬度 */
  .date-next-step-btn,
  .timeslot-next-step-btn {
    min-width: 240px;
  }
}

/* ========== 無障礙優化 ========== */

/* 鍵盤焦點樣式 */
.date-expand-btn:focus,
.date-next-step-btn:focus,
.timeslot-next-step-btn:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

/* 減少動畫（尊重用戶偏好） */
@media (prefers-reduced-motion: reduce) {
  .date-btn,
  .date-next-step-container,
  .timeslot-next-step-container,
  .date-expand-btn .expand-icon,
  .date-next-step-btn svg,
  .timeslot-next-step-btn svg {
    animation: none;
    transition: none;
  }
}



/* ========== 動態折扣樣式 ========== */

/* 遲到預訂時段按鈕 */
.time-slot-btn.late-booking {
  position: relative;
  border: 2px solid #ff9800;
  background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
}

/* Late-booking hover 效果已移除 - 避免滑鼠懸停時按鈕變色 */

/* 半小時時段價格（橙色顯示） */
.time-slot-price.late-booking-price {
  color: #ff5722;
  font-weight: 700;
}

/* 遲到預訂時段的閃爍效果（吸引注意） */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 152, 0, 0);
  }
}

.time-slot-btn.late-booking:not(.selected) {
  animation: pulse 2s infinite;
}

/* 選中的遲到預訂時段 */
.time-slot-btn.late-booking.selected {
  border-color: #4CAF50;
  background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.time-slot-btn.late-booking.selected .late-booking-price {
  color: #2e7d32;
}

/* ========== 移動端優化 ========== */

@media (max-width: 768px) {
  .time-slot-price.late-booking-price {
    font-size: 14px;
  }
}

/* ========== 無障礙優化 ========== */

/* 減少動畫（尊重用戶偏好） */
@media (prefers-reduced-motion: reduce) {
  .time-slot-btn.late-booking {
    animation: none;
  }
}

/* 高對比度模式 */
@media (prefers-contrast: high) {
  .time-slot-btn.late-booking {
    border-width: 3px;
  }
  
  .time-slot-price.late-booking-price {
    font-weight: 900;
  }
}

