/* Enhanced Blue & White Theme */
* {
  box-sizing: border-box;
  font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
}

:root {
  --primary-color: #1976d2;
  --primary-dark: #0d47a1;
  --primary-light: #bbdefb;
  --accent-color: #03a9f4;
  --text-light: #ffffff;
  --text-dark: #212121;
  --text-muted: #757575;
  --bg-light: #f5f9ff;
  --bg-white: #ffffff;
  --shadow-soft: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-strong: 0 10px 30px rgba(0,0,0,0.2);
  --border-radius: 12px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-light);
}

#chat-icon {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-light);
  padding: 15px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chat-icon:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: var(--shadow-strong);
  animation: pulse 1.5s infinite;
}

#chat-window {
  position: fixed;
  bottom: 20px;
  right: 100px;
  width: 40%; /* Reduced from 80% to 40% of viewport width */
  max-width: 600px; /* Reduced from 1200px */
  height: 90vh; /* Increased from 85vh to 90vh */
  max-height: none;
  background: var(--bg-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  margin-right: 20px;
}

.chat-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-light);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

.header-content {
  display: flex;
  align-items: center;
}

.logo {
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 5px;
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

#close-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

#close-btn:hover {
  background: rgba(255,255,255,0.4);
}

#chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.chat-input-container {
  display: flex;
  flex-wrap: wrap;
  padding: 18px; /* Increased from 15px */
  background: var(--bg-white);
  border-top: 1px solid rgba(0,0,0,0.05);
  position: relative;
}

#chat-input {
  flex: 1;
  min-height: 70px; /* Increased from 60px */
  padding: 15px 20px; /* Increased padding */
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  resize: none;
  font-size: 16px; /* Increased from 15px */
  transition: border 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05) inset;
  margin-right: 15px; /* Increased from 10px */
}

#chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

#send-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-light);
  padding: 0 25px; /* Increased from 20px */
  border: none;
  border-radius: 20px;
  margin-left: 10px;
  cursor: pointer;
  height: 70px; /* Increased from 60px */
  font-weight: 500;
  font-size: 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#send-btn:active {
  transform: translateY(0);
}

.hidden {
  display: none !important;
  transform: translateY(20px);
  opacity: 0;
}

.message {
  max-width: 85%; /* Increased from 70% to use more of the available width */
  margin-bottom: 20px;
  padding: 15px 20px;
  border-radius: 18px;
  line-height: 1.6;
  word-wrap: break-word;
  font-size: 16px;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--text-light);
  border-bottom-right-radius: 5px;
}

.message.assistant {
  align-self: flex-start;
  background: var(--bg-white);
  color: var(--text-dark);
  border-bottom-left-radius: 5px;
  border-left: 4px solid var(--primary-color);
}

.file-upload {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
}

.file-upload label {
  cursor: pointer;
  margin-left: 5px;
  margin-right: 5px;
  font-size: 24px;
  color: var(--primary-color);
  background: rgba(25, 118, 210, 0.1);
  width: 50px; /* Increased from 40px */
  height: 50px; /* Increased from 40px */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.file-upload label:hover {
  background: rgba(25, 118, 210, 0.2);
  transform: scale(1.1);
}

.file-upload label .tooltip {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.file-upload label:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.file-upload input[type="file"] {
  display: none;
}

.typing-indicator {
  display: flex;
  align-items: center;
  align-self: flex-start;
  background: var(--bg-white);
  padding: 15px;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: bounce 1.2s infinite ease-in-out;
}

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

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

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

/* Image preview */
.image-preview {
  max-width: 150px;
  max-height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--primary-light);
}

#image-preview-container {
  width: 100%;
  padding: 10px;
  background-color: rgba(25, 118, 210, 0.05);
  border-radius: 8px;
  margin-bottom: 10px;
  position: relative;
}

.image-message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 5px;
}

.image-message img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  margin-top: 5px;
  border: 1px solid var(--primary-light);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  #chat-window {
    width: 45%;
    right: 80px;
  }
}

@media (max-width: 768px) {
  #chat-window {
    width: 60%;
    right: 50px;
    height: 85vh;
  }
}

@media (max-width: 480px) {
  #chat-window {
    width: 90%; /* Adjusted from 95% */
    right: 5%;
    bottom: 90px;
    height: 80vh; /* Increased from 75vh */
    margin-right: 0;
  }
  
  #chat-icon {
    bottom: 15px;
    right: 15px;
  }
  
  .chat-input-container {
    padding: 12px;
  }
  
  #chat-input {
    min-height: 60px;
    font-size: 15px;
    padding: 12px 15px;
  }
  
  #send-btn {
    height: 60px;
    padding: 0 15px;
  }
  
  .file-upload label {
    width: 40px;
    height: 40px;
  }
  
  .message {
    max-width: 85%;
    font-size: 15px;
    padding: 12px 16px;
  }
}

/* Additional animations */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(25, 118, 210, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0); }
} 

.message strong {
  font-weight: 700;
  color: inherit;
}

.message em {
  font-style: italic;
  color: inherit;
}

.message u {
  text-decoration: underline;
  color: inherit;
}

/* Make sure assistant message formatting looks good with the colored border */
.message.assistant strong {
  color: var(--primary-dark);
}

.message-content {
  width: 100%;
} 