/* 秘坊到會 Chat Widget — Floating Button Style */
:root {
  --secretin-green: #4A7C59;
  --secretin-cream: #FFF8F0;
  --secretin-brown: #8B6914;
  --secretin-dark: #2D2D2D;
}

#secretin-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--secretin-green);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 28px;
  color: white;
}
#secretin-chat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

#secretin-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 99998;
  width: 380px;
  max-height: 560px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}
#secretin-chat-window.open {
  display: flex;
}

.secretin-chat-header {
  background: var(--secretin-green);
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.secretin-chat-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.secretin-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.secretin-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  min-height: 180px;
  max-height: 400px;
  background: #fafaf8;
}

.secretin-chat-msg {
  margin-bottom: 12px;
  animation: fadeIn 0.25s ease;
}
.secretin-chat-msg.assistant .msg-bubble {
  background: white;
  border: 1px solid #e8e5df;
  border-radius: 12px 12px 12px 4px;
  padding: 10px 14px;
  max-width: 92%;
  font-size: 13px;
  line-height: 1.55;
  color: #333;
}
.secretin-chat-msg.user .msg-bubble {
  background: var(--secretin-green);
  color: white;
  border-radius: 12px 12px 4px 12px;
  padding: 10px 14px;
  max-width: 82%;
  margin-left: auto;
  font-size: 13px;
  line-height: 1.5;
}
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  font-size: 14px;
  margin: 6px 0 4px;
}
.msg-bubble ul, .msg-bubble ol {
  margin: 4px 0;
  padding-left: 18px;
}
.msg-bubble li { margin: 2px 0; }

.secretin-chat-typing {
  display: none;
  padding: 8px 14px;
  color: #999;
  font-size: 12px;
  font-style: italic;
}
.secretin-chat-typing.show { display: block; }

.secretin-chat-input-area {
  display: flex;
  border-top: 1px solid #ede8e0;
  padding: 10px;
  gap: 8px;
  background: white;
}
.secretin-chat-input-area input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.secretin-chat-input-area input:focus {
  border-color: var(--secretin-green);
}
.secretin-chat-input-area button {
  background: var(--secretin-green);
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

.secretin-chat-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  background: #fafaf8;
  border-top: 1px solid #ede8e0;
}
.secretin-chat-quick-btns button {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.secretin-chat-quick-btns button:hover {
  background: var(--secretin-cream);
  border-color: var(--secretin-green);
}

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

@media (max-width: 480px) {
  #secretin-chat-window {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  .secretin-chat-body { max-height: none; }
}
