/* ============================================================
   MUSE Hair Salon — LINE 預約 Bot Demo
   ============================================================ */

:root {
  --line-green: #06c755;
  --line-green-dark: #05a648;
  --bg-page: #eef1f3;
  --chat-bg-top: #e9f1f4;
  --chat-bg-bottom: #dfe9ee;
  --bubble-bot: #ffffff;
  --bubble-user: #06c755;
  --text-main: #1c1c1e;
  --text-sub: #6b7178;
  --timestamp: #99a1a8;
  --card-radius: 16px;
  --shadow-soft: 0 2px 8px rgba(20, 30, 40, 0.08);
  --shadow-card: 0 4px 16px rgba(20, 30, 40, 0.10);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg-page);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(6, 199, 85, 0.06), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(91, 141, 239, 0.07), transparent 40%);
  min-height: 100vh;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* ---------------- 頁面外層排版 ---------------- */

.page-wrap {
  display: flex;
  align-items: center;
  gap: 56px;
  max-width: 1080px;
  width: 100%;
}

.intro-note {
  flex: 1 1 320px;
  max-width: 380px;
}

.intro-note .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--line-green-dark);
  background: rgba(6, 199, 85, 0.1);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.intro-note h1 {
  font-size: 28px;
  line-height: 1.4;
  margin: 0 0 16px;
  font-weight: 700;
  color: #101418;
}

.intro-note p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-sub);
  margin: 0 0 14px;
}

.intro-note .feature-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro-note .feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-main);
}

.intro-note .feature-list li::before {
  content: "✓";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--line-green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ---------------- 手機外框 ---------------- */

.phone-shell {
  position: relative;
  flex-shrink: 0;
  width: 390px;
  height: 844px;
  background: #0b0b0d;
  border-radius: 54px;
  padding: 14px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.2),
    inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.phone-shell::before {
  /* 側邊音量鍵裝飾 */
  content: "";
  position: absolute;
  left: -3px;
  top: 130px;
  width: 3px;
  height: 60px;
  background: #1c1c1e;
  border-radius: 2px 0 0 2px;
}

.phone-notch {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background: #0b0b0d;
  border-radius: 20px;
  z-index: 20;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 40px;
  overflow: hidden;
  background: #fff;
}

/* ---------------- 聊天室 App ---------------- */

.chat-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--chat-bg-bottom);
}

.chat-statusbar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 22px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #1a2a25;
}

.chat-statusbar .status-icons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #1a2a25;
  color: #fff;
}

.chat-header .icon-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  opacity: 0.9;
}

.chat-header .header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a674ff, #6f7bff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.chat-header .header-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-header .header-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-header .header-name {
  font-size: 15.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header .verified-badge {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #06c755;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header .header-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
}

.chat-header .header-actions {
  display: flex;
  gap: 2px;
}

/* ---------------- 訊息區 ---------------- */

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 10px;
  background: linear-gradient(180deg, var(--chat-bg-top), var(--chat-bg-bottom) 220px);
  scroll-behavior: smooth;
}

.chat-day-divider {
  text-align: center;
  margin: 4px 0 14px;
}

.chat-day-divider span {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-sub);
  font-size: 11.5px;
  padding: 4px 12px;
  border-radius: 999px;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 10px;
  animation: msg-in 0.25s ease;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-row.user {
  justify-content: flex-end;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #a674ff, #6f7bff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-col {
  display: flex;
  flex-direction: column;
  max-width: 76%;
}

.msg-row.user .msg-col {
  align-items: flex-end;
}

.msg-time-wrap {
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.msg-row.user .msg-time-wrap {
  flex-direction: row-reverse;
}

.msg-time {
  font-size: 10.5px;
  color: var(--timestamp);
  white-space: nowrap;
  margin-bottom: 2px;
}

.bubble {
  background: var(--bubble-bot);
  color: var(--text-main);
  padding: 9px 13px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  font-size: 14.5px;
  line-height: 1.6;
  box-shadow: var(--shadow-soft);
  white-space: pre-line;
  word-break: break-word;
}

.msg-row.user .bubble {
  background: var(--bubble-user);
  color: #fff;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 16px;
}

/* 打字中指示器 */

.typing-bubble {
  background: var(--bubble-bot);
  padding: 12px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-bubble .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7bcc2;
  animation: dot-bounce 1.1s infinite ease-in-out;
}

.typing-bubble .dot:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------------- 互動元件（Flex 風格卡片 / 按鈕群） ---------------- */

.msg-group {
  margin: 2px 0 14px 35px;
  max-width: 88%;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip-btn {
  border: 1.5px solid var(--line-green);
  background: #fff;
  color: var(--line-green-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.chip-btn:hover:not(:disabled) {
  background: rgba(6, 199, 85, 0.08);
}

.chip-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.chip-btn:disabled {
  border-color: #dcdfe2;
  color: #b3b8bd;
  cursor: default;
  background: #f4f5f6;
}

.chip-btn.is-full {
  border-color: #e3e5e7;
  color: #c3c7cb;
  background: repeating-linear-gradient(135deg, #f4f5f6, #f4f5f6 4px, #eceeef 4px, #eceeef 8px);
  text-decoration: line-through;
}

.chip-btn.is-selected {
  background: var(--line-green);
  color: #fff;
}

/* 卡片橫向捲動（服務項目） */

.card-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 4px;
  scroll-snap-type: x proximity;
}

.card-scroll::-webkit-scrollbar {
  height: 5px;
}

.card-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.service-card {
  scroll-snap-align: start;
  flex: 0 0 148px;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.service-card .card-media {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, #ffe1ec, #e4ebff);
}

.service-card .card-body {
  padding: 10px 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.service-card .card-title {
  font-size: 14px;
  font-weight: 700;
}

.service-card .card-desc {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.4;
  min-height: 30px;
}

.service-card .card-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--line-green-dark);
  margin-top: 2px;
}

.service-card .card-select-btn {
  margin-top: 6px;
  border: none;
  background: var(--line-green);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}

.service-card .card-select-btn:disabled {
  background: #d8dbde;
  cursor: default;
}

/* 直式清單卡片（設計師 / 預約查詢） */

.list-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.list-card:last-child {
  margin-bottom: 0;
}

.list-card .avatar-lg {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}

.list-card .info {
  flex: 1;
  min-width: 0;
}

.list-card .info .name {
  font-size: 14.5px;
  font-weight: 700;
}

.list-card .info .meta {
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 2px;
  line-height: 1.5;
}

.list-card .select-btn {
  flex-shrink: 0;
  border: 1.5px solid var(--line-green);
  background: #fff;
  color: var(--line-green-dark);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.list-card .select-btn:disabled {
  border-color: #dcdfe2;
  color: #b3b8bd;
  cursor: default;
}

/* Flex 卡片：確認 / 成功 / 價目表 / 我的預約 */

.flex-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.flex-card .flex-header {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f0f1f2;
}

.flex-card .flex-header .flex-icon {
  font-size: 20px;
}

.flex-card .flex-header .flex-title {
  font-size: 15px;
  font-weight: 700;
}

.flex-card .flex-rows {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.flex-card .flex-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  gap: 12px;
}

.flex-card .flex-row .k {
  color: var(--text-sub);
  flex-shrink: 0;
}

.flex-card .flex-row .v {
  font-weight: 600;
  text-align: right;
}

.flex-card .flex-price {
  padding: 4px 16px 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--line-green-dark);
  text-align: right;
}

.flex-card .flex-footer {
  display: flex;
  border-top: 1px solid #f0f1f2;
}

.flex-card .flex-footer button {
  flex: 1;
  border: none;
  background: #fff;
  padding: 12px 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--line-green-dark);
  cursor: pointer;
  font-family: inherit;
}

.flex-card .flex-footer button + button {
  border-left: 1px solid #f0f1f2;
  color: var(--text-sub);
}

.flex-card .flex-footer button:disabled {
  color: #c3c7cb;
  cursor: default;
}

.flex-card.success .flex-header {
  background: linear-gradient(135deg, #06c755, #05a648);
  border-bottom: none;
}

.flex-card.success .flex-header .flex-title,
.flex-card.success .flex-header .flex-icon {
  color: #fff;
}

.flex-card .booking-code {
  margin: 0 16px 12px;
  background: #f4f9f6;
  border: 1px dashed #b9e6c9;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  font-size: 13px;
  color: var(--line-green-dark);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* 價目表 */

.price-table {
  padding: 6px 16px 14px;
}

.price-table .price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f2f3f4;
  font-size: 13.5px;
}

.price-table .price-item:last-child {
  border-bottom: none;
}

.price-table .price-item .name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.price-table .price-item .price {
  color: var(--line-green-dark);
  font-weight: 700;
}

/* ---------------- 輸入列 ---------------- */

.chat-inputbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid #eceeef;
}

.chat-inputbar .plus-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #f0f2f3;
  color: #7a8188;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.chat-inputbar input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid #e4e6e8;
  background: #f4f5f6;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
}

.chat-inputbar input[type="text"]:focus {
  border-color: var(--line-green);
  background: #fff;
}

.chat-inputbar .send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--line-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.chat-inputbar .send-btn:active {
  background: var(--line-green-dark);
}

.chat-inputbar .send-btn:disabled {
  background: #d8dbde;
  cursor: default;
}

/* ---------------- RWD ---------------- */

@media (max-width: 900px) {
  .page-wrap {
    flex-direction: column;
    gap: 28px;
  }
  .intro-note {
    max-width: 460px;
    text-align: center;
  }
  .intro-note .feature-list {
    align-items: center;
  }
  .intro-note .feature-list li {
    text-align: left;
  }
}

@media (max-width: 720px) {
  body {
    padding: 0;
    align-items: stretch;
  }
  .page-wrap {
    gap: 0;
  }
  .intro-note {
    display: none;
  }
  .phone-shell {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .phone-shell::before {
    display: none;
  }
  .phone-notch {
    display: none;
  }
  .phone-screen {
    border-radius: 0;
    height: 100dvh;
  }
}

/* ---------------- 動態減弱偏好 ---------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chat-log {
    scroll-behavior: auto;
  }
}
