/* widget/css/chat-widget.css - Multi-theme support with CSS variables */
:root {
  --akemo-primary: #2c5aa0;
  --akemo-primary-dark: #1e4080;
  --akemo-header-gradient: linear-gradient(135deg, #2c5aa0 0%, #1e4080 100%);
  --akemo-user-bubble: #2c5aa0;
  --akemo-assistant-bubble: #ffffff;
  --akemo-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.akemo-widget {
  font-family: var(--akemo-font);
  position: fixed;
  z-index: 999999;
}

.akemo-widget.bottom-right {
  bottom: 20px;
  right: 20px;
}

.akemo-widget.bottom-left {
  bottom: 20px;
  left: 20px;
}

/* Toggle button - Pill shape with text */
.akemo-toggle {
  width: 140px;
  height: 48px;
  border-radius: 24px;
  background: var(--akemo-header-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(91, 155, 213, 0.4);
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.akemo-toggle svg {
  width: 20px;
  height: 20px;
}

.akemo-toggle:hover {
  box-shadow: 0 6px 20px rgba(91, 155, 213, 0.5);
  transform: scale(1.02);
  filter: brightness(0.9);
}

.akemo-widget.open .akemo-toggle {
  display: none;
}

.akemo-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4444;
  color: white;
  border-radius: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
}

/* Chat window */
.akemo-chat-window {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.akemo-widget.open .akemo-chat-window {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

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

/* Header */
.akemo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--akemo-header-gradient);
  color: white;
}

.akemo-header-left strong {
  font-size: 16px;
  font-weight: 600;
}

.akemo-header-right {
  display: flex;
  gap: 8px;
}

.akemo-restart,
.akemo-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.akemo-restart:hover,
.akemo-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Welcome section */
.akemo-welcome-section {
  padding: 32px 20px;
  text-align: center;
  background: white;
  border-bottom: 1px solid #e0e0e0;
}

.akemo-logo {
  margin: 0 auto 16px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.akemo-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.akemo-welcome-title {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.akemo-welcome-subtitle {
  font-size: 16px;
  color: #666;
}

/* Messages area */
.akemo-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f5f5;
}

/* Message bubble */
.akemo-message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease-out;
}

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

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

.akemo-message.assistant,
.akemo-message.system {
  align-items: flex-start;
}

.akemo-message-content {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
}

.akemo-message.user .akemo-message-content {
  background: var(--akemo-user-bubble);
  color: white;
  border-bottom-right-radius: 4px;
}

.akemo-message.assistant .akemo-message-content,
.akemo-message.system .akemo-message-content {
  background: var(--akemo-assistant-bubble);
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.akemo-message-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  padding: 0 4px;
}

/* Typing indicator */
.akemo-typing-dots {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.akemo-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* Input area */
.akemo-input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

#akemo-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  transition: all 0.2s;
}

#akemo-input:focus {
  border: 2px solid var(--akemo-primary);
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.1);
}

.akemo-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.akemo-send-btn.disabled {
  background: #f5f5f5;
  color: #ccc;
  cursor: not-allowed;
}

.akemo-send-btn.enabled {
  background: var(--akemo-primary);
  color: white;
}

.akemo-send-btn.enabled:hover {
  background: var(--akemo-primary-dark);
  transform: scale(1.05);
}

.akemo-send-btn.enabled:active {
  transform: scale(0.95);
}

/* Footer */
.akemo-footer {
  padding: 12px 20px;
  text-align: center;
  font-size: 12px;
  color: #999;
  background: white;
  border-top: 1px solid #e0e0e0;
}

.akemo-footer a {
  color: var(--akemo-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.akemo-footer a:hover {
  color: var(--akemo-primary-dark);
  text-decoration: underline;
}

/* Floating close button */
.akemo-float-close {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--akemo-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 999998;
}

.akemo-widget.open .akemo-float-close {
  display: flex;
}

.akemo-float-close:hover {
  background: var(--akemo-primary-dark);
  transform: scale(1.05);
}

.akemo-float-close svg {
  transform: rotate(0deg);
  transition: transform 0.2s;
}

.akemo-float-close:hover svg {
  transform: rotate(90deg);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .akemo-chat-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 140px);
    bottom: 80px;
    right: 20px;
  }
}

/* Scrollbar styling */
.akemo-messages::-webkit-scrollbar {
  width: 6px;
}

.akemo-messages::-webkit-scrollbar-track {
  background: transparent;
}

.akemo-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.akemo-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}
