/* ==========================================================================
   Hamed Sport Assistant - Interactive Chatbot Widget Styles
   ========================================================================== */

.hamed-widget-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  font-family: var(--br-font);
  direction: rtl;
  text-align: right;
}

/* Floating Trigger Button */
.hamed-trigger-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--br-primary) 0%, #003d80 100%);
  color: var(--br-white);
  padding: 8px 18px 8px 10px;
  border-radius: 40px;
  box-shadow: 0 8px 24px rgba(0, 86, 179, 0.35);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hamed-trigger-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 86, 179, 0.45);
}
.hamed-avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--br-secondary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.hamed-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hamed-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #fff;
  border-radius: 50%;
}
.hamed-trigger-text {
  display: flex;
  flex-direction: column;
}
.hamed-trigger-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.hamed-trigger-sub {
  font-size: 11px;
  color: #fed7aa;
  font-weight: 600;
}

/* Speech Bubble Prompt */
.hamed-floating-bubble {
  position: absolute;
  bottom: 74px;
  left: 0;
  background: #fff;
  color: var(--br-dark);
  padding: 10px 16px;
  border-radius: 16px 16px 16px 4px;
  box-shadow: var(--br-shadow-lg);
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--br-border);
  white-space: nowrap;
  animation: bubbleFloat 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hamed-floating-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 24px;
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #fff transparent;
}
.hamed-close-bubble {
  cursor: pointer;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
}

@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Chat Window Box */
.hamed-chat-window {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 380px;
  height: 560px;
  max-height: 85vh;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.22);
  border: 1px solid var(--br-border);
  overflow: hidden;
  flex-direction: column;
  animation: chatFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hamed-chat-window.is-active {
  display: flex;
}

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

/* Chat Header */
.hamed-chat-header {
  background: linear-gradient(135deg, var(--br-primary) 0%, #003875 100%);
  color: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--br-secondary);
}
.hamed-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hamed-header-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--br-secondary);
  overflow: hidden;
}
.hamed-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hamed-header-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.hamed-header-info p {
  font-size: 11px;
  color: #bbf7d0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hamed-chat-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
}
.hamed-chat-close-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* Chat Messages Area */
.hamed-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Message Bubbles */
.hamed-msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}
.hamed-msg-bot {
  align-self: flex-start;
}
.hamed-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.hamed-msg-content {
  background: #fff;
  padding: 12px 14px;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--br-dark);
}
.hamed-msg-user .hamed-msg-content {
  background: var(--br-primary);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.hamed-quick-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.hamed-opt-btn {
  background: #f1f5f9;
  border: 1px solid var(--br-border);
  color: var(--br-primary);
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: right;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hamed-opt-btn:hover {
  background: var(--br-primary-light);
  border-color: var(--br-primary);
  transform: translateX(-3px);
}
.hamed-whatsapp-link-btn {
  background: #25d366;
  color: #fff;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  text-decoration: none;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}
.hamed-whatsapp-link-btn:hover {
  background: #1eb956;
  color: #fff;
}

/* Chat Input Bar */
.hamed-chat-footer {
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--br-border);
  display: flex;
  gap: 8px;
}
.hamed-input-field {
  flex: 1;
  border: 1px solid var(--br-border);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
}
.hamed-input-field:focus {
  border-color: var(--br-primary);
  background: #fff;
}
.hamed-send-btn {
  background: var(--br-secondary);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
}
.hamed-send-btn:hover {
  background: var(--br-secondary-dark);
}

@media (max-width: 480px) {
  .hamed-chat-window {
    width: calc(100vw - 32px);
    left: 16px;
    bottom: 70px;
    height: 75vh;
  }
  .hamed-widget-container {
    bottom: 74px;
    left: 16px;
  }
}
