/* Formal, elegant ChatGPT-style design */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

#ryan-jacob-chat-container {
  max-width: 900px;
  margin: 20px auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  height: 700px;
  overflow: hidden;
}

#ryan-jacob-chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px 32px;
  text-align: center;
  border-radius: 12px 12px 0 0;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-controls {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 8px;
}

.music-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.music-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.music-btn.playing {
  background: rgba(255, 255, 255, 0.3);
  animation: musicPulse 2s ease-in-out infinite;
}

@keyframes musicPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

#ryan-jacob-chat-header h3 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

#ryan-jacob-chat-header p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  font-weight: 400;
}

#ryan-jacob-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
}

.ryan-jacob-message {
  padding: 20px 32px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color 0.2s ease;
}

.ryan-jacob-message:hover {
  background: #f3f4f6;
}

.user-message {
  background: #ffffff;
}

.assistant-message {
  background: #f9fafb;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-message .message-avatar {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.assistant-message .message-avatar {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.message-sender {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.message-content {
  line-height: 1.6;
  color: #374151;
  font-size: 15px;
  word-wrap: break-word;
  white-space: pre-wrap;
  padding-left: 44px;
  font-weight: 400;
}

.message-time {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
  padding-left: 44px;
  font-weight: 400;
}

#ryan-jacob-chat-input-container {
  padding: 20px 32px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  border-radius: 0 0 12px 12px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  background: #ffffff;
}

#ryan-jacob-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  resize: none;
  min-height: 20px;
  max-height: 120px;
  font-family: inherit;
  color: #374151;
  line-height: 1.5;
  font-weight: 400;
}

#ryan-jacob-chat-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

#ryan-jacob-chat-send {
  margin-left: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

#ryan-jacob-chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

#ryan-jacob-chat-send:active {
  transform: translateY(0);
}

.loading-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6b7280;
  font-size: 15px;
  padding-left: 44px;
  font-weight: 400;
}

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: #8b5cf6;
  border-radius: 50%;
  animation: loadingPulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loadingPulse {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Scrollbar styling */
#ryan-jacob-chat-messages::-webkit-scrollbar {
  width: 6px;
}

#ryan-jacob-chat-messages::-webkit-scrollbar-track {
  background: #f3f4f6;
}

#ryan-jacob-chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

#ryan-jacob-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Mobile responsive design with proper bottom spacing */
@media (max-width: 768px) {
  #ryan-jacob-chat-container {
    margin: 0;
    height: calc(100vh - 100px); /* Leave space for phone buttons */
    max-height: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  #ryan-jacob-chat-header {
    border-radius: 0;
    padding: 20px 16px;
  }

  .ryan-jacob-message {
    padding: 16px 20px;
  }

  .message-content {
    padding-left: 36px;
    font-size: 14px;
  }

  .message-time {
    padding-left: 36px;
  }

  .loading-content {
    padding-left: 36px;
  }

  #ryan-jacob-chat-input-container {
    padding: 16px 20px 24px; /* Extra bottom padding for mobile */
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .header-controls {
    top: 16px;
    right: 16px;
  }
}

/* Message animations */
.ryan-jacob-message {
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
