/* Widget base styles */
.amber-chat-widget-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.amber-chat-widget-root {
  width: 100%;
  height: 100%;
}

/* Animation for widget appearance */
@keyframes amber-widget-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes amber-widget-fade-in {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes amber-widget-bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes amber-message-slide-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes amber-message-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes amber-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(65, 182, 230, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(65, 182, 230, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(65, 182, 230, 0);
  }
}

@keyframes amber-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.amber-chat-window {
  animation: amber-widget-slide-up 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  resize: both;
  overflow: auto;
  min-width: 320px;
  min-height: 400px;
  max-width: 600px;
  max-height: 800px;
  transform-origin: bottom right;
}

.amber-chat-window.closing {
  animation: amber-widget-slide-down 0.3s ease-in forwards;
}

@keyframes amber-widget-slide-down {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

.amber-chat-icon-button {
  animation: amber-widget-bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.amber-chat-icon-button:hover {
  animation: amber-pulse 2s infinite;
}

/* Resize handle styling */
.amber-chat-window::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.1) 50%);
  pointer-events: auto;
}

/* Scrollbar styles */
.amber-chat-window ::-webkit-scrollbar {
  width: 6px;
}

.amber-chat-window ::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.amber-chat-window ::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.amber-chat-window ::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Message styles */
.amber-chat-message {
  margin-bottom: 12px;
  opacity: 0;
  animation: amber-message-fade-up 0.4s ease-out forwards;
}

@keyframes amber-message-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.amber-chat-message-user {
  display: flex;
  justify-content: flex-end;
  animation: amber-message-slide-in-right 0.3s ease-out forwards;
}

.amber-chat-message-bot {
  display: flex;
  justify-content: flex-start;
  animation: amber-message-slide-in 0.3s ease-out forwards;
}

.amber-chat-message-content {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 8px;
  word-wrap: break-word;
}

.amber-chat-message-user .amber-chat-message-content {
  background-color: #1a365d;
  color: white;
  border-bottom-right-radius: 4px;
}

.amber-chat-message-bot .amber-chat-message-content {
  background-color: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

/* Thinking indicator */
.amber-thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  width: fit-content;
  margin: 8px 0;
}

.amber-thinking-dot {
  width: 8px;
  height: 8px;
  background-color: #6b7280;
  border-radius: 50%;
  animation: amber-thinking-bounce 1.4s infinite ease-in-out both;
}

.amber-thinking-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.amber-thinking-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.amber-thinking-dot:nth-child(3) {
  animation-delay: 0;
}

@keyframes amber-thinking-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Profile picture styles */
.amber-message-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amber-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Message links styling */
.amber-chat-message-content a {
  color: #41B6E6;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.amber-chat-message-content a:hover {
  color: #3399cc;
  text-decoration: underline;
}

.amber-chat-message-user .amber-chat-message-content a {
  color: #93c5fd;
}

.amber-chat-message-user .amber-chat-message-content a:hover {
  color: #bfdbfe;
}

/* Action buttons */
.amber-action-buttons {
  margin: 12px 0;
  padding: 12px;
  background-color: #f0f9ff;
  border-radius: 8px;
  border: 1px solid #bae6fd;
}

.amber-action-button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  margin-bottom: 8px;
  background-color: #0ea5e9;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.amber-action-button:hover {
  background-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.amber-action-button:active {
  transform: translateY(0);
}

/* Input styles */
.amber-chat-input-container {
  display: flex;
  gap: 8px;
  width: 100%;
}

.amber-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

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

.amber-chat-input:focus {
  border-color: #41B6E6;
  background-color: rgba(255, 255, 255, 0.15);
}

.amber-chat-input:disabled {
  background-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.3);
}

.amber-chat-send-button {
  padding: 10px;
  min-width: 44px;
  height: 44px;
  background-color: #41B6E6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amber-chat-send-button:hover:not(:disabled) {
  background-color: #3399cc;
  transform: scale(1.05);
}

.amber-chat-send-button:disabled {
  background-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.3);
}

/* Input wrapper styles */
input[type="text"]::-webkit-input-placeholder {
  color: rgba(255, 255, 255, 0.5);
}

input[type="text"]::-moz-placeholder {
  color: rgba(255, 255, 255, 0.5);
}

input[type="text"]:-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.5);
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
