﻿/* ===========================
   CHATBOT CSS – ParaVolley Egypt
   =========================== */

/* ==============================
   FLOATING VOLLEYBALL BUTTON
   ============================== */
.chatbot-trigger {
  position: fixed !important;
  bottom: 32px;
  right: 32px;
  left: auto;
  width: 68px;
  height: 68px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 9998;
  padding: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-trigger:hover {
  transform: scale(1.1) rotate(-10deg);
}

.chatbot-ball {
  width: 68px;
  height: 68px;
  position: relative;
}

/* SVG volleyball */
.chatbot-ball svg {
  width: 68px;
  height: 68px;
  animation: volleyballFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(200, 16, 46, 0.45));
}

/* Ripple rings */
.chatbot-ring {
  position: absolute;
  width: 68px;
  height: 68px;
  border: 2px solid rgba(200, 16, 46, 0.4);
  border-radius: 50%;
  top: 0;
  left: 0;
  animation: ringPulse 2s ease-out infinite;
}

.chatbot-ring:nth-child(2) { animation-delay: 0.7s; }
.chatbot-ring:nth-child(3) { animation-delay: 1.4s; }

/* Badge */
.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--dark);
}

/* ==============================
   CHATBOT WINDOW
   ============================== */
.chatbot-window {
  position: fixed;
  bottom: 116px;
  right: 32px;
  left: auto;
  width: 380px;
  height: 560px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 20px 80px rgba(200, 16, 46, 0.2), 0 8px 32px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1999;
  transform: scale(0.8) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
}

.chatbot-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-dark) 100%);
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chatbot-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.25);
}

.chatbot-header-info {
  flex: 1;
}

.chatbot-header-name {
  font-size: 15px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
}

.chatbot-header-status {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-status-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: glowPulse 2s ease-in-out infinite;
}

.chatbot-header-actions {
  display: flex;
  gap: 8px;
}

.chatbot-header-btn {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chatbot-header-btn:hover { background: rgba(255,255,255,0.22); }

/* Quick Suggestions */
.chatbot-suggestions {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
  background: var(--primary-bg);
  border-bottom: 1px solid rgba(0,87,184,0.08);
  scrollbar-width: none;
}

.chatbot-suggestions::-webkit-scrollbar { display: none; }

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: white;
  border: 1.5px solid rgba(0,87,184,0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--royal-blue);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--trans-fast);
  font-family: inherit;
}

.suggestion-chip:hover {
  background: var(--royal-blue);
  color: white;
  border-color: var(--royal-blue);
  transform: translateY(-1px);
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: rgba(0,87,184,0.2); border-radius: 2px; }

/* Message bubbles */
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: fadeInUp 0.3s ease;
}

.chat-msg.user {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--royal-blue), var(--royal-blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.chat-msg.user .chat-msg-avatar {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
}

.chat-msg-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.chat-msg.bot .chat-msg-bubble {
  background: var(--primary-bg);
  color: var(--dark);
  border-radius: 4px 18px 18px 18px;
  border: 1px solid rgba(0,87,184,0.08);
}

.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, var(--royal-blue), var(--royal-blue-light));
  color: white;
  border-radius: 18px 18px 4px 18px;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
  opacity: 0.7;
}

.chat-msg.user .chat-msg-time { text-align: left; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--primary-bg);
  border-radius: 4px 18px 18px 18px;
  border: 1px solid rgba(0,87,184,0.08);
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--royal-blue);
  border-radius: 50%;
  opacity: 0.4;
  animation: typingDot 1.2s ease-in-out infinite;
}

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

@keyframes typingDot {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-5px); }
}

/* Input Area */
.chatbot-input-area {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,87,184,0.08);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  background: var(--white);
}

.chatbot-input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid rgba(0,87,184,0.12);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: var(--primary-bg);
  color: var(--dark);
}

.chatbot-input:focus {
  border-color: var(--royal-blue);
  background: white;
}

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

.chatbot-send-btn,
.chatbot-voice-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--trans-fast);
  flex-shrink: 0;
}

.chatbot-send-btn {
  background: linear-gradient(135deg, var(--royal-blue), var(--royal-blue-light));
  color: white;
  box-shadow: 0 4px 12px rgba(0,87,184,0.3);
}

.chatbot-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,87,184,0.4);
}

.chatbot-voice-btn {
  background: rgba(0,87,184,0.08);
  color: var(--royal-blue);
}

.chatbot-voice-btn:hover {
  background: rgba(0,87,184,0.15);
  transform: scale(1.05);
}

.chatbot-voice-btn.listening {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  animation: glowPulse 1s ease-in-out infinite;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 32px);
    right: 16px;
    left: 16px;
    height: 75vh;
    bottom: 104px;
  }
  .chatbot-trigger {
    bottom: 24px;
    right: 16px;
    left: auto;
  }
}
