/* ======================== */
/* CHATBOT WIDGET STYLES    */
/* ======================== */

:root {
  --primary-color: #d4af37;
  --secondary-color: #1a1a1a;
  --accent-color: #3a6ea5;
  --text-light: #ffffff;
  --text-dark: #333333;
  --border-radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#chess-chatbot-widget {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chatbot-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 998;
  animation: pulse 2s infinite;
}

.chatbot-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.4);
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.3);
  }
}

.chatbot-container {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 420px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  z-index: 999;
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.chatbot-container.active {
  display: flex;
}

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

.chatbot-header {
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  color: var(--text-light);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-logo {
  width: 32px;
  height: 32px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-header-text h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.chatbot-header-text p {
  font-size: 13px;
  opacity: 1;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 20px;
  transition: opacity 0.2s;
}

.chatbot-close:hover {
  opacity: 0.7;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
}

.message {
  display: flex;
  gap: 8px;
  animation: messageIn 0.3s ease;
}

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

.message.user {
  justify-content: flex-end;
}

.message-content {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--border-radius);
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.message.user .message-content {
  background: var(--accent-color);
  color: var(--text-light);
  border-bottom-right-radius: 4px;
}

.message.bot .message-content {
  background: white;
  color: var(--text-dark);
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

.typing-indicator {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 12px;
}

.typing-dot {
  width: 3px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.chatbot-input-area {
  padding: 12px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 60px;
  transition: border-color 0.2s;
}

.chatbot-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.1);
}

.chatbot-send {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
}

.chatbot-send:hover {
  background: #2a5a8a;
  transform: scale(1.05);
}

.chatbot-send:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: scale(1);
}

.chatbot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  text-align: center;
}

.chatbot-empty-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.chatbot-empty h4 {
  font-size: 13px;
  color: var(--accent-color);
  margin-bottom: 2px;
  font-weight: 600;
}

.chatbot-empty p {
  font-size: 11px;
  color: #a0a0a0;
  line-height: 1.3;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #2a5a8a;
}

@media (max-width: 480px) {
  .chatbot-container {
    width: 100%;
    height: 70vh;
    right: 0;
    bottom: 0;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    max-height: 70vh;
  }

  .chatbot-button {
    width: 56px;
    height: 56px;
    bottom: 20px;
    right: 20px;
  }

  .message-content {
    max-width: 85%;
  }
  
  .chatbot-empty {
    padding: 10px 12px;
  }
  
  .chatbot-empty-icon {
    font-size: 24px;
    margin-bottom: 4px;
  }
  
  .chatbot-empty h4 {
    font-size: 12px;
  }
  
  .chatbot-empty p {
    font-size: 10px;
  }
}
