/**
 * Ratidzo Health AI Chat Styles
 */

/* Chat Container */
.chat-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  max-width: 90vw;
  height: 500px;
  max-height: 70vh;
  background: rgba(26, 32, 44, 0.95);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  transform: translateY(20px);
  opacity: 0;
}

.chat-container.chat-open {
  transform: translateY(0);
  opacity: 1;
}

/* Chat Header */
.chat-header {
  padding: 15px;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  color: white;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.chat-title i {
  font-size: 1.2rem;
}

#chat-close-button {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

#chat-close-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 20px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 5px;
  animation: fadeIn 0.3s ease-out;
  word-wrap: break-word;
}

.user-message {
  align-self: flex-end;
  background: linear-gradient(to right, var(--color-primary-dark), var(--color-primary));
  color: white;
  border-bottom-right-radius: 2px;
}

.ai-message {
  align-self: flex-start;
  background: rgba(45, 55, 72, 0.8);
  color: white;
  border-bottom-left-radius: 2px;
}

.ai-message.error {
  background: rgba(220, 38, 38, 0.2);
  border-left: 3px solid #ef4444;
}

.error-details {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 5px;
}

.message-content {
  display: flex;
  flex-direction: column;
}

.message-content p {
  margin: 0;
  line-height: 1.5;
}

.message-content p + p {
  margin-top: 8px;
}

/* Typing Indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.typing-indicator span {
  animation: blink 1.4s infinite both;
  height: 4px;
  width: 4px;
  margin: 0 2px;
  background: white;
  border-radius: 50%;
  display: inline-block;
}

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

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

@keyframes blink {
  0% { opacity: 0.1; }
  20% { opacity: 1; }
  100% { opacity: 0.1; }
}

/* Chat Input Area */
.chat-input-area {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

#chat-input {
  flex: 1;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(45, 55, 72, 0.5);
  color: white;
  resize: none;
  font-family: inherit;
  transition: all 0.3s;
  max-height: 120px;
  overflow-y: auto;
}

#chat-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: rgba(45, 55, 72, 0.8);
}

#chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#chat-send-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-end;
}

#chat-send-button:hover {
  transform: scale(1.05);
}

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

.chat-disclaimer {
  margin-top: 10px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* Responsiveness */
@media (max-width: 480px) {
  .chat-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  
  .chat-header {
    border-radius: 0;
  }
} 