/**
 * @file    : css/chatbot/chatbot-window.css
 * @purpose : 聊天視窗主體、標題列、輸入區樣式
 * @depends : ['css/variables.css']
 */

/* ========================================
   Chat Window
   ======================================== */
.chat-window {
  position: fixed;
  bottom: 104px;
  right: 24px;
  z-index: 999;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 150px);
  background: #fffaf5;
  border: 1px solid rgba(210, 105, 30, 0.15);
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(62, 39, 35, 0.12),
    0 8px 24px rgba(210, 105, 30, 0.08);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ========================================
   Chat Header
   ======================================== */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #d2691e 0%, #a0522d 100%);
  position: relative;
}

.chat-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.8rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-header-text h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}

.chat-header-text span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
}

/* Online indicator dot */
.chat-header-text span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 4px rgba(74, 222, 128, 0.5);
}

.chat-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.chat-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Chat Input Area
   ======================================== */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid rgba(210, 105, 30, 0.08);
  background: #fff;
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: #fdf8f3;
  border: 1px solid rgba(210, 105, 30, 0.15);
  border-radius: 12px;
  color: #3e2723;
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: #d2691e;
  box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.1);
}

.chat-input::placeholder {
  color: #a89080;
}

.chat-send {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d2691e 0%, #a0522d 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(210, 105, 30, 0.25);
}

.chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(210, 105, 30, 0.35);
}

.chat-send:active {
  transform: scale(0.95);
}
