/* ===========================================================
   Chat Assistant Styles - Toolkit #4
   Clean, professional chat interface
=========================================================== */

/* Floating Action Button */
.chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: var(--white);
  font-size: 1.8rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 99999;
}

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.chat-fab:active {
  transform: scale(0.95);
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 4rem);
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, var(--teal), var(--teal-light));
  color: var(--white);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.chat-header-content {
  display: flex;
  flex-direction: column;
}

.chat-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.chat-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.2rem;
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.chat-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--soft-gray);
}

/* Individual Messages */
.chat-message {
  display: flex;
  margin-bottom: 0.5rem;
}

.chat-message-user {
  justify-content: flex-end;
}

.chat-message-assistant {
  justify-content: flex-start;
}

.message-content {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message-user .message-content {
  background: var(--teal);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-message-assistant .message-content {
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border-gray);
  border-bottom-left-radius: 4px;
}

/* Input Container */
.chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--white);
  border-top: 1px solid var(--border-gray);
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: var(--teal);
}

.chat-send-btn {
  padding: 0.75rem 1.25rem;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.chat-send-btn:hover {
  background: var(--teal-dark);
}

.chat-send-btn:active {
  transform: scale(0.98);
}

/* Quick Actions */
.chat-quick-actions {
  padding: 0.75rem 1rem 1rem;
  background: var(--white);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--border-gray);
}

.quick-action-btn {
  padding: 0.5rem 0.75rem;
  background: var(--soft-gray);
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-dark);
  font-weight: 500;
}

.quick-action-btn:hover {
  background: var(--teal-light);
  color: var(--white);
  border-color: var(--teal-light);
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-gray);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 2rem);
    height: calc(100vh - 2rem);
    bottom: 1rem;
    right: 1rem;
  }
  
  .chat-fab {
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
  }
  
  .message-content {
    max-width: 85%;
  }
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message {
  animation: slideInUp 0.3s ease;
}

/* Dark text in messages for readability */
.chat-message-assistant .message-content {
  color: var(--text-dark);
}

.chat-message-assistant .message-content strong {
  color: var(--teal-dark);
  font-weight: 600;
}