/**
 * A Long Story - Chatbot Widget Styles
 * Original Design - Phase 1: Text Only
 */

/* Chatbot Styles */
#chatbot-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b6f47 0%, #6b5435 100%);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
}

.chat-panel {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: linear-gradient(135deg, #8b6f47 0%, #6b5435 100%);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
}

.chat-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.audio-toggle-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.audio-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f5f5f5;
}

.chat-message {
  margin-bottom: 12px;
  display: flex;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.message-content {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.4;
  font-size: 14px;
  white-space: pre-wrap;
}

.chat-message.user .message-content {
  background: #8b6f47;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant .message-content {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-input-container {
  display: flex;
  padding: 12px;
  background: white;
  border-top: 1px solid #e0e0e0;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
}

.chat-input:focus {
  border-color: #8b6f47;
}

.chat-mic-btn {
  padding: 10px 14px;
  background: white;
  color: #8b6f47;
  border: 2px solid #8b6f47;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-mic-btn:hover {
  background: #f5f5f5;
}

.chat-mic-btn.recording {
  background: #ff4444;
  color: white;
  border-color: #ff4444;
  animation: pulse 1.5s infinite;
}

.chat-mic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.chat-send-btn {
  padding: 10px 20px;
  background: #8b6f47;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.chat-send-btn:hover {
  background: #6b5435;
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-status {
  padding: 8px 12px;
  font-size: 12px;
  color: #666;
  background: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.typing-indicator {
  display: inline-block;
  padding: 10px 14px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #8b6f47;
  border-radius: 50%;
  margin: 0 2px;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
  .chat-panel {
    width: calc(100vw - 40px);
    height: calc(100vh - 140px);
    bottom: 70px;
  }
}
