/* Chat Container Styles - Matches Portfolio Design */
/* Scoped to only affect elements within .chat-container */

.chat-container {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(10, 61, 98, 0.08);
  width: 100%;
  max-width: 600px;
  height: clamp(420px, 65vh, 700px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0 auto 2rem auto;
}

.chat-header {
  background: #0a3d62;
  color: #fff;
  padding: 1.5rem 2rem;
  text-align: center;
  border-radius: 20px 20px 0 0;
}

.chat-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.chat-subtitle {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 300;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.5);
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(10, 61, 98, 0.05);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(10, 61, 98, 0.2);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 61, 98, 0.3);
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: fadeIn 0.3s ease-in;
}

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

.user-message {
  align-self: flex-end;
  align-items: flex-end;
}

.bot-message {
  align-self: flex-start;
  align-items: flex-start;
}

.message-content {
  padding: 0.75rem 1.25rem;
  border-radius: 18px;
  word-wrap: break-word;
  line-height: 1.5;
}

.user-message .message-content {
  background: #0a3d62;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bot-message .message-content {
  background: rgba(56, 173, 169, 0.15);
  color: #222;
  border-bottom-left-radius: 4px;
}

.message-content p {
  margin: 0;
  font-size: 0.95rem;
}

.message.loading .message-content {
  background: rgba(56, 173, 169, 0.1);
  color: #666;
}

.typing-indicator {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38ada9;
  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-container {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(10, 61, 98, 0.1);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 2px solid rgba(10, 61, 98, 0.15);
  border-radius: 25px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.chat-input:focus {
  border-color: #38ada9;
  box-shadow: 0 0 0 3px rgba(56, 173, 169, 0.1);
}

.chat-input:disabled {
  background: rgba(10, 61, 98, 0.05);
  cursor: not-allowed;
}

.send-button {
  background: #0a3d62;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
  background: #38ada9;
  transform: scale(1.05);
}

.send-button:active:not(:disabled) {
  transform: scale(0.95);
}

.send-button:disabled {
  background: rgba(10, 61, 98, 0.3);
  cursor: not-allowed;
}

.chat-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  min-height: 1.2rem;
}

.error-message {
  color: #d32f2f;
}

/* Responsive Design */
@media (max-width: 768px) {
  .chat-container {
    height: clamp(420px, 70vh, 640px);
    border-radius: 15px;
  }

  .chat-header {
    padding: 1.25rem 1.5rem;
    border-radius: 15px 15px 0 0;
  }

  .chat-header h2 {
    font-size: 1.25rem;
  }

  .chat-subtitle {
    font-size: 0.85rem;
  }

  .chat-messages {
    padding: 1rem;
  }

  .message {
    max-width: 85%;
  }

  .message-content {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }

  .chat-input-container {
    padding: 1rem;
  }

  .chat-input {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .send-button {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .chat-header h2 {
    font-size: 1.1rem;
  }

  .chat-subtitle {
    font-size: 0.8rem;
  }

  .message {
    max-width: 90%;
  }
}

