/* ============================================
   職涯停看聽 × 預約系統 — 溫暖專業主題
   主色：暖土色 #C4622D
   背景：米白 #F5F0E8
   字體：Playfair Display + DM Sans
   ============================================ */

:root {
  /* 色彩系統 */
  --bg-primary:    #F5F0E8;   /* 米白背景 */
  --bg-secondary:  #EDE8DF;   /* 稍深米白，用於區塊對比 */
  --bg-card:       #FFFFFF;   /* 卡片白 */

  --primary-color: #C4622D;   /* 暖土色主色 */
  --primary-hover: #A8511F;   /* 深一點的主色 hover */
  --primary-light: #F3E8E0;   /* 極淺土色，用於背景強調 */
  --primary-gradient: linear-gradient(135deg, #C4622D 0%, #E8956A 100%);

  --accent-color:  #2C7A5C;   /* 深綠色點綴（確認/成功狀態） */
  --accent-light:  #E6F4EE;

  --text-primary:  #1C1C1A;   /* 深灰主文字 */
  --text-secondary:#4A4540;   /* 次要文字 */
  --text-muted:    #8C8480;   /* 淡灰提示文字 */

  --border-color:  #DDD8CF;   /* 邊框 */
  --border-hover:  #C4622D;   /* hover 邊框 */

  --shadow-sm: 0 1px 4px rgba(28,28,26,0.06);
  --shadow-md: 0 4px 16px rgba(28,28,26,0.10);
  --shadow-lg: 0 12px 40px rgba(28,28,26,0.12);

  /* 玻璃擬態（改為淺色版本） */
  --glass-bg:     rgba(255, 255, 255, 0.75);
  --glass-border: rgba(196, 98, 45, 0.12);
  --glass-shadow: var(--shadow-lg);

  /* 輸入框 */
  --input-bg:     #FFFFFF;
  --input-border: #DDD8CF;

  /* 字體 */
  --font-body:    'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
}

/* ── Reset ─────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.7;
}

/* ── 背景裝飾（改為溫暖色調暈染） ────────── */
.background-glassmorphism {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  filter: blur(120px);
  opacity: 0.35;
  border-radius: 50%;
  animation: float 25s infinite alternate ease-in-out;
}

.blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(196,98,45,0.5) 0%, rgba(196,98,45,0) 70%);
  top: -150px; left: -150px;
}

.blob-2 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(232,149,106,0.4) 0%, rgba(232,149,106,0) 70%);
  bottom: -200px; right: -150px;
  animation-delay: -8s;
}

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 40px) scale(1.08); }
}

/* ── Loading Overlay ──────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 240, 232, 0.9);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border-color);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

#loadingText {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

/* 預約處理中動畫 */
.booking-animation {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.pulse-loader {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 0 0 rgba(196, 98, 45, 0.6);
  animation: pulse-ring 1.5s cubic-bezier(0.66, 0, 0, 1) infinite;
  margin-bottom: 30px;
  display: flex; align-items: center; justify-content: center;
}
.pulse-loader::after {
  content: '✓';
  color: white; font-size: 40px; font-weight: 800;
  animation: pulse-check 1.5s infinite;
}
.booking-status-text {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
@keyframes pulse-ring {
  to { box-shadow: 0 0 0 40px rgba(196, 98, 45, 0); }
}
@keyframes pulse-check {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* ── App Layout ───────────────────────── */
.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 48px auto;
  padding: 0 24px;
  z-index: 1;
}

.app-header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInDown 0.7s ease-out;
}

/* 標題：Playfair Display 衬線體，暖土色 */
.gradient-text {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 12px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* 查詢預約按鈕（膠囊型） */
.lookup-trigger {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}
.lookup-trigger:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: var(--shadow-md);
}
.lookup-trigger .icon {
  width: 15px; height: 15px; margin-right: 7px;
}

/* 兩欄格線 */
.app-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 28px;
}

/* ── 卡片面板（白底+精緻陰影，取代玻璃擬態） ── */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.7s ease-out both;
}

.booking-panel  { animation-delay: 0.05s; }
.calendar-panel { animation-delay: 0.2s; }

.panel-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary-light);
}
.panel-title .icon {
  width: 22px; height: 22px;
  margin-right: 10px;
  color: var(--primary-color);
}

/* ── 表單 ─────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}
.form-group label, label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

input, select {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.97rem;
  padding: 13px 15px;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
}
input:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(196, 98, 45, 0.12);
}
input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}
select option { background: #fff; color: var(--text-primary); }

/* ── 方案卡片 ─────────────────────────── */
.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.plan-card {
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.plan-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--primary-light);
}
.plan-card.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px -5px rgba(196, 98, 45, 0.45);
}
.plan-card.active * { color: white !important; }

.plan-card .name     { font-size: 0.88rem; font-weight: 700; margin-bottom: 5px; color: var(--text-primary); }
.plan-card .price    { font-size: 1.05rem; font-weight: 800; color: var(--primary-color); }
.plan-card .duration { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.plan-card .desc     { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; margin-top: 6px; white-space: pre-line; }

.plan-card .check-mark {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px;
  background: white; color: var(--primary-color);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  opacity: 0; transform: scale(0.5);
  transition: all 0.25s ease;
  z-index: 1;
}
.plan-card.active .check-mark { opacity: 1; transform: scale(1); }

/* 方案封面圖片 */
.plan-card-img {
  width: calc(100% + 24px);
  margin: -16px -12px 10px;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  height: 100px;
}
.plan-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.plan-card:hover .plan-card-img img { transform: scale(1.05); }
.plan-card.active .plan-card-img { opacity: 0.85; }

/* ── 時段選取框 ─────────────────────────── */
.time-status-container {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
}
.time-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.time-status-box {
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.35s ease;
}
.time-status-box.empty {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1.5px dashed var(--border-color);
}
.time-status-box.selected {
  background: var(--accent-light);
  color: var(--accent-color);
  border: 1.5px solid rgba(44, 122, 92, 0.3);
}

/* ── 主按鈕 ───────────────────────────── */
.btn-primary {
  width: 100%;
  margin-top: 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 15px 20px;
  border-radius: 8px;       /* 個人網站按鈕圓角極小 */
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(196, 98, 45, 0.35);
  letter-spacing: 0.3px;
}
.btn-primary .btn-icon {
  width: 18px; height: 18px; margin-left: 8px;
  transition: transform 0.25s ease;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(196, 98, 45, 0.45);
}
.btn-primary:hover:not(:disabled) .btn-icon {
  transform: translateX(4px);
}
.btn-primary:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* 輪廓按鈕 */
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ── FullCalendar 客製化 ──────────────── */
.fc {
  font-family: var(--font-body);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--bg-secondary);
  --fc-neutral-text-color: var(--text-primary);
  --fc-border-color: var(--border-color);
  --fc-today-bg-color: rgba(196, 98, 45, 0.07);
  --fc-button-bg-color: var(--bg-card);
  --fc-button-border-color: var(--border-color);
  --fc-button-text-color: var(--text-secondary);
  --fc-button-hover-bg-color: var(--primary-color);
  --fc-button-hover-border-color: var(--primary-color);
  --fc-button-active-bg-color: var(--primary-color);
}
.fc-theme-standard th,
.fc-theme-standard td,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--border-color);
}
.fc-col-header-cell-cushion,
.fc-timegrid-slot-label-cushion {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none !important;
}
.fc-col-header-cell-cushion:hover { color: var(--primary-color); }
.fc-highlight { background: rgba(196, 98, 45, 0.12) !important; }
.fc-v-event {
  background-color: var(--primary-color) !important;
  border: none !important;
  border-radius: 6px;
  padding: 2px 5px;
}
.fc-event.busy-event,
.fc-event.busy-event .fc-event-main { cursor: not-allowed !important; opacity: 0.85; }
.fc-event.busy-event .fc-event-title { font-size: 0.78rem; font-weight: 700; }
.fc-event-main { color: white; font-size: 0.82rem; font-weight: 600; }
.fc-toolbar-title { font-family: var(--font-display); color: var(--text-primary) !important; font-size: 1.15rem !important; }
.fc-button { border-radius: 6px !important; font-weight: 600 !important; }

/* ── 查詢預約 Modal ───────────────────── */
.lookup-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 26, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease;
}
.lookup-modal.hidden { opacity: 0; pointer-events: none; }
.modal-content {
  width: 100%;
  max-width: 480px;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
}
.close-btn {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.close-btn:hover { color: var(--text-primary); }
.modal-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── 查詢結果卡片 ─────────────────────── */
.lookup-results-area {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}
.result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.result-card:hover { border-color: var(--primary-color); }
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.result-plan { color: var(--text-primary); font-weight: 700; }
.result-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}
.status-confirmed { background: #D1FAE5; color: #065F46; }
.status-cancelled { background: #FEE2E2; color: #991B1B; }
.status-pending   { background: #FEF3C7; color: #92400E; }
.result-time { color: var(--text-muted); font-size: 0.85rem; }

/* 取消 / 改期按鈕 */
.btn-cancel-inline {
  flex: 1;
  margin-top: 12px;
  padding: 9px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel-inline:hover { background: #FEE2E2; }
.btn-reschedule-inline {
  flex: 1;
  margin-top: 12px;
  padding: 9px;
  background: var(--primary-light);
  border: 1px solid rgba(196, 98, 45, 0.3);
  color: var(--primary-color);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-reschedule-inline:hover { background: rgba(196, 98, 45, 0.15); }

.reschedule-pulse {
  animation: bg-pulse-warm 2s infinite;
}
@keyframes bg-pulse-warm {
  0%   { box-shadow: 0 0 0 0 rgba(196, 98, 45, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(196, 98, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 98, 45, 0); }
}

.cancel-reason-text {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #FEF2F2;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #EF4444;
}

/* ── 優惠券 & 價格總計 ─────────────────── */
.coupon-section {
  background: var(--primary-light);
  border: 1px dashed rgba(196, 98, 45, 0.3);
  border-radius: 12px;
  padding: 0 16px 16px 16px;
  margin-top: 24px;
  animation: fadeIn 0.4s ease-out;
}
.price-summary {
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.price-row.total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-top: 4px;
}

/* ── 評價展示區塊 ─────────────────────── */
#reviewsSection .glass-panel {
  background: var(--bg-card);
}

/* ── 動畫 ─────────────────────────────── */
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }

/* ── Toast 通知 ───────────────────────── */
#sysToast {
  font-family: var(--font-body) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
}

/* ── 手機版 RWD ───────────────────────── */
@media (max-width: 900px) {
  .app-grid {
    display: flex;
    flex-direction: column;
  }
  .gradient-text { font-size: 2.2rem; }
  .app-container { margin: 32px auto; }
  .glass-panel   { padding: 22px 18px; }
  .calendar-panel { margin-top: 0; }
}

@media (max-width: 600px) {
  .gradient-text { font-size: 1.8rem; }
  .subtitle      { font-size: 0.9rem; }
  .app-container { padding: 0 14px; margin: 20px auto; }

  .fc-toolbar-title { font-size: 1rem !important; }
  .fc-col-header-cell-cushion { font-size: 0.78rem !important; }
  .fc-timegrid-slot-label-cushion { font-size: 0.7rem !important; }

  /* 方案卡片：小螢幕改 2 欄 */
  .plan-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  /* 極小螢幕（iPhone SE 等）方案卡片改單欄 */
  .plan-cards-grid { grid-template-columns: 1fr; }

  /* Modal 全屏底部圓角處理 */
  .modal-content {
    max-width: 100%;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh;
  }
  .lookup-modal {
    align-items: flex-end;
    padding: 0;
  }

  /* 按鈕最小高度確保可點擊（iOS 44px 標準） */
  .btn-cancel-inline,
  .btn-reschedule-inline,
  .btn-primary {
    padding: 12px 10px !important;
    min-height: 44px;
  }
}
