/* AI 手機介面 - 預設打開 */
.ai-chat-mobile {
  position: fixed;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: 750px;
  background: #000;
  border-radius: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

/* DEMO 標籤 */
.ai-demo-label {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0A4174, #4E8EA2);
  color: white;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(10, 65, 116, 0.3);
}

/* 手機螢幕 */
.ai-phone-screen {
  flex: 1;
  background: white;
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 瀏海 */
.ai-phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 28px;
  background: #000;
  border-radius: 0 0 20px 20px;
  z-index: 10;
}

/* 狀態欄 */
.ai-status-bar {
  height: 44px;
  background: linear-gradient(135deg, #0A4174, #4E8EA2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  padding-top: 8px;
  color: white;
  font-size: 12px;
}

.ai-status-time {
  font-weight: 600;
}

.ai-status-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* 聊天標題欄 */
.ai-chat-header-mobile {
  background: linear-gradient(135deg, #0A4174, #4E8EA2);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-back-button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ai-chat-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar-mobile {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.ai-chat-name {
  flex: 1;
}

.ai-name-mobile {
  font-weight: 600;
  font-size: 16px;
}

.ai-status-mobile {
  font-size: 12px;
  opacity: 0.9;
}

.ai-more-button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 消息區域 */
.ai-messages-mobile {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-message-mobile {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: slideUp 0.3s ease;
}

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

.ai-message-mobile.user-message {
  flex-direction: row-reverse;
}

.ai-message-avatar-mobile {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0A4174, #4E8EA2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ai-message-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 70%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  line-height: 1.5;
  font-size: 15px;
  color: #333;
  position: relative;
}

.user-message .ai-message-bubble {
  background: linear-gradient(135deg, #0A4174, #4E8EA2);
  color: white;
}

.ai-message-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  text-align: center;
}

/* 輸入區域 */
.ai-input-area-mobile {
  background: white;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #e5e7eb;
}

.ai-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 24px;
  padding: 8px 16px;
  gap: 8px;
}

.ai-emoji-button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
}

.ai-input-mobile {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #333;
}

.ai-input-mobile::placeholder {
  color: #9ca3af;
}

.ai-voice-btn-mobile {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0A4174, #4E8EA2);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  transition: all 0.2s;
}

.ai-voice-btn-mobile.recording {
  background: #ef4444;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ai-send-btn-mobile {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0A4174, #4E8EA2);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  flex-shrink: 0;
  transition: all 0.2s;
}

.ai-send-btn-mobile:active {
  transform: scale(0.95);
}

/* Home 指示器 */
.ai-home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

/* 滾動條 */
.ai-messages-mobile::-webkit-scrollbar {
  width: 4px;
}

.ai-messages-mobile::-webkit-scrollbar-track {
  background: transparent;
}

.ai-messages-mobile::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

/* 響應式 */
@media (max-width: 1200px) {
  .ai-chat-mobile {
    left: 20px;
    width: 380px;
    height: 680px;
  }
}

@media (max-width: 768px) {
  .ai-chat-mobile {
    display: none;
  }
}

/* 三點跳動 loading 動畫 */
.ai-typing-indicator {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ai-typing-dot {
  width: 10px;
  height: 10px;
  background: #6b7280;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.ai-typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.ai-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

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