/* Chat toggle button for mobile */
.chat-toggle-fixed {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 50%;
  text-align: center;
  line-height: 60px;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
}

.chat-toggle-fixed:hover {
  background-color: #2980b9;
  transform: scale(1.05);
}

/* Close chat button */
.close-chat-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: none;
}



.chat-container {
  display: flex;
  flex-direction: column;
  top: 0;
  height: 100%;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header {
  background-color: black;
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: bold;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header .header-title {
  font-size: 0.95em;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.header-icon {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  padding: 4px;
}

.header-icon:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Remove duplicate definition */

.image-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px 10px;
  max-height: 200px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.03);
  border-top: 1px solid #e0e0e0;
}

.image-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Make sure user message images look good */
.user-message img, .ai-message img {
  max-width: 200px;
  border-radius: 5px;
  margin: 5px 0;
  display: block;
}

  max-height: calc(100% - 120px); /* Account for header and input area */
}

.message {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 18px;
  margin-bottom: 5px;
  margin-left: 10px;
  margin-right: 10px;
  word-break: break-word;
}

.user-message {
  align-self: flex-end;
  background-color: #1e00ff;
  color: white;
  border-bottom-right-radius: 5px;
  padding: 10px;
  font-size: 12px;
  border-radius: 10px;
  box-shadow: 0 10px 10px rgb(3, 3, 3, 0.6);
}

.ai-message {
  align-self: flex-start;
  background-color: #e6e6e6;
  color: black;
  border-bottom-left-radius: 5px;
  padding: 10px;
  font-size: 12px;
  border-radius: 10px;
  box-shadow: 0 10px 10px rgb(0, 8, 245, 0.6);
}

.chat-input-container {
  display: flex;
  padding: 10px;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  align-items: center;
}

.chat-image-icon {
  color: #3498db;
  font-size: 18px;
  margin-right: 10px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.chat-image-icon:hover {
  color: #2980b9;
}

.chat-input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid #3498db;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  outline: none;
}

.chat-input:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.chat-input::placeholder {
  color: #95a5a6;
}

/* For tablets and mobile */
@media (max-width: 992px) {
  .chat-container {
    margin-bottom: 20px;
  }
}

.chat-buttons button {
  background-color: #6366f1;
  border: none;
  color: white;
  border-radius: 50%;
  padding: 10px;
  margin-left: 8px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-buttons button:hover {
  background-color: #4f46e5;
}

.chat-buttons .icon-button {
  background-color: #818cf8;
}

.chat-buttons .icon-button:hover {
  background-color: #6366f1;
}

#image-preview {
  width: 100%;
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

#image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-message img {
  max-width: 200px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: block;
}