/* ===== CRICKO CHATBOT STYLING ===== */

/* Chatbot Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  border: none;
  color: #06070f;
  font-size: 24px;
  cursor: pointer;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(240, 165, 0, 0.4);
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(240, 165, 0, 0.5);
}

.chatbot-toggle:active {
  transform: scale(0.95);
}

.chatbot-toggle.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(240, 165, 0, 0.4);
  }
  50% {
    box-shadow: 0 6px 30px rgba(240, 165, 0, 0.6);
  }
}

/* Chatbot Container */
.cricket-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 0;
  background: var(--bg2);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  transition: height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.cricket-chatbot.open {
  height: 600px;
  opacity: 1;
  pointer-events: all;
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--gold), var(--rose));
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  color: #06070f;
  font-weight: 700;
}

.chatbot-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chatbot-title i {
  font-size: 18px;
}

.chatbot-close {
  background: none;
  border: none;
  color: #06070f;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chatbot-close:hover {
  transform: rotate(90deg);
  opacity: 0.8;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

/* Message Styles */
.chatbot-message {
  display: flex;
  animation: slideIn 0.3s ease;
}

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

.bot-message {
  justify-content: flex-start;
}

.bot-message .message-content {
  background: rgba(240, 165, 0, 0.15);
  border: 1px solid rgba(240, 165, 0, 0.3);
  border-radius: 12px;
  padding: 12px;
  max-width: 80%;
  color: var(--white);
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

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

.user-message .message-content {
  background: linear-gradient(135deg, var(--gold), var(--rose));
  border-radius: 12px;
  padding: 12px;
  max-width: 80%;
  color: #06070f;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
  font-weight: 500;
}

/* Message Content Links */
.message-content a {
  color: var(--gold) !important;
  text-decoration: underline;
  transition: all 0.2s ease;
}

.user-message .message-content a {
  color: #06070f !important;
  font-weight: 700;
}

.message-content a:hover {
  opacity: 0.8;
}

/* Input Area */
.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--bg2);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.chatbot-input::placeholder {
  color: var(--muted);
}

.chatbot-input:focus {
  border-color: rgba(240, 165, 0, 0.5);
  background: rgba(240, 165, 0, 0.04);
}

.chatbot-send {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  border: none;
  border-radius: 8px;
  color: #06070f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(240, 165, 0, 0.3);
}

.chatbot-send:active {
  transform: scale(0.95);
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(240, 165, 0, 0.3);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(240, 165, 0, 0.5);
}

/* Light Mode Adjustments */
html[data-theme="light"] .cricket-chatbot {
  background: var(--bg2);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .chatbot-messages {
  background: var(--bg);
}

html[data-theme="light"] .bot-message .message-content {
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(217, 119, 6, 0.3);
  color: #1f2937;
}

html[data-theme="light"] .chatbot-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #1f2937;
}

html[data-theme="light"] .chatbot-input::placeholder {
  color: #9ca3af;
}

html[data-theme="light"] .chatbot-input:focus {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(217, 119, 6, 0.04);
}

html[data-theme="light"] .message-content {
  color: #1f2937;
}

html[data-theme="light"] .message-content a {
  color: #d97706 !important;
}

html[data-theme="light"] .chatbot-input-area {
  background: var(--bg2);
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* Responsive Design */
@media (max-width: 600px) {
  .cricket-chatbot {
    width: calc(100vw - 32px);
    max-width: 100%;
    right: 16px;
    bottom: 80px;
  }

  .cricket-chatbot.open {
    height: 500px;
  }

  .chatbot-toggle {
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .cricket-chatbot {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 70px;
  }

  .cricket-chatbot.open {
    height: 450px;
  }

  .chatbot-toggle {
    width: 48px;
    height: 48px;
    font-size: 20px;
    bottom: 8px;
    right: 8px;
  }

  .bot-message .message-content,
  .user-message .message-content {
    max-width: 90%;
  }
}
