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

/* Chat Button */
.chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d3b66 0%, #2a6f7e 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn.active {
  background: #dc3545;
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 550px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chat-window.active {
  display: flex;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #0d3b66 0%, #2a6f7e 100%);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-icon {
  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;
}

.chat-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-header-text p {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

/* Message Bubbles */
.message {
  display: flex;
  gap: 10px;
  animation: slideIn 0.3s ease;
  align-items: flex-start;
}

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

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d3b66 0%, #2a6f7e 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: #6c757d;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
  width: 100%;
}

.message.assistant .message-content {
  background: white;
  color: #2d3748;
  border-bottom-left-radius: 4px;
}

.message.user .message-content {
  background: linear-gradient(135deg, #0d3b66 0%, #2a6f7e 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  padding: 12px 16px;
  background: white;
  border-radius: 12px;
  width: fit-content;
}

.typing-indicator.active {
  display: block;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background: #cbd5e0;
  border-radius: 50%;
  display: inline-block;
  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);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Chat Input */
.chat-input {
  padding: 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

.chat-input-field {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-field:focus {
  border-color: #0d3b66;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d3b66 0%, #2a6f7e 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

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

/* Welcome Message */
.welcome-message {
  text-align: center;
  padding: 20px;
  color: #718096;
}

.welcome-message h4 {
  color: #2d3748;
  margin-bottom: 8px;
  font-size: 16px;
}

.welcome-message p {
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    right: 10px;
    bottom: 80px;
  }

  .chat-toggle-btn {
    right: 10px;
    bottom: 10px;
  }
}

/* Error Message */
.error-message {
  background: #fee;
  color: #c00;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin: 10px 0;
  border-left: 3px solid #c00;
}

/* Message Content Wrapper */
.message-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 70%;
}

/* GPT Link Container */
.gpt-link-container {
  margin-top: 4px;
}

/* GPT Link Button */
.gpt-link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(13, 59, 102, 0.08);
  color: #0d3b66;
  text-decoration: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid rgba(13, 59, 102, 0.2);
}

.gpt-link-button:hover {
  background: rgba(13, 59, 102, 0.12);
  border-color: rgba(13, 59, 102, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gpt-link-button i {
  font-size: 10px;
}
