/* Med Red Sea — Chat with us */
.mrs-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  min-width: 62px;
  height: 56px;
  padding: 0 20px 0 16px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #FF8C42 0%, #2EC4B6 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 140, 66, 0.5), 0 0 0 4px rgba(46, 196, 182, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: mrs-fab-glow 2.5s ease-in-out infinite;
}

.mrs-fab-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50px;
  border: 2px solid rgba(46, 196, 182, 0.6);
  animation: mrs-fab-ring 2s ease-out infinite;
  pointer-events: none;
}

@keyframes mrs-fab-glow {
  0%, 100% { box-shadow: 0 6px 24px rgba(255, 140, 66, 0.5), 0 0 0 4px rgba(46, 196, 182, 0.2); }
  50% { box-shadow: 0 8px 32px rgba(46, 196, 182, 0.55), 0 0 0 8px rgba(255, 140, 66, 0.15); }
}

@keyframes mrs-fab-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}

.mrs-fab-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }

.mrs-fab-label {
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.mrs-chat-fab:hover {
  transform: scale(1.05) translateY(-2px);
}

.mrs-chat-fab.open {
  width: 56px;
  padding: 0;
  border-radius: 50%;
  animation: none;
}

.mrs-chat-fab.open .mrs-fab-pulse,
.mrs-chat-fab.open .mrs-fab-icon,
.mrs-chat-fab.open .mrs-fab-label { display: none; }

.mrs-chat-fab .mrs-fab-close { display: none; font-size: 20px; }
.mrs-chat-fab.open .mrs-fab-close { display: block; }

.mrs-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 9998;
  width: min(400px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 140px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(26, 58, 92, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mrs-chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mrs-chat-header {
  background: linear-gradient(135deg, #1a3a5c 0%, #2EC4B6 100%);
  color: #fff;
  padding: 18px 16px 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.mrs-chat-close {
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.mrs-chat-close:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.08);
}

[dir="rtl"] .mrs-chat-close {
  margin-left: 0;
  margin-right: auto;
}

.mrs-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid rgba(255,255,255,0.4);
}

.mrs-chat-header-info h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.mrs-chat-header-info {
  flex: 1;
  min-width: 0;
}

.mrs-chat-header-info p {
  font-size: 0.75rem;
  opacity: 0.9;
  margin: 2px 0 0;
}

.mrs-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mrs-chat-status::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: mrs-blink 1.5s infinite;
}

@keyframes mrs-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.mrs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #FFFDF7, #FFF8F0);
}

.mrs-chat-msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.mrs-chat-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.mrs-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #FF8C42, #FF6B6B);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.mrs-chat-msg.typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}

.mrs-chat-msg.typing span {
  width: 8px;
  height: 8px;
  background: #2EC4B6;
  border-radius: 50%;
  animation: mrs-typing 1.2s infinite;
}

.mrs-chat-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.mrs-chat-msg.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mrs-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.mrs-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  background: #FFF8F0;
}

.mrs-chat-quick button {
  border: 1px solid #2EC4B6;
  background: #fff;
  color: #1a3a5c;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.mrs-chat-quick button:hover {
  background: #2EC4B6;
  color: #fff;
}

.mrs-chat-help-btns {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  background: #FFF8F0;
}

.mrs-chat-help-btns.visible {
  display: flex;
}

.mrs-chat-help-btns button {
  flex: 1;
  min-width: 120px;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s;
}

.mrs-chat-help-btns button[data-help="yes"] {
  background: linear-gradient(135deg, #2EC4B6, #0EA5E9);
  color: #fff;
}

.mrs-chat-help-btns button[data-help="no"] {
  background: #fff;
  color: #636e72;
  border: 1px solid #ddd;
}

.mrs-chat-help-btns button:hover { transform: scale(1.03); }

.mrs-chat-input-area {
  padding: 12px 16px 16px;
  background: #fff;
  border-top: 1px solid #eee;
}

.mrs-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.mrs-chat-input-row input {
  flex: 1;
  border: 2px solid #e8e8e8;
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.mrs-chat-input-row input:focus {
  border-color: #2EC4B6;
}

.mrs-chat-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8C42, #2EC4B6);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.mrs-chat-send:hover { transform: scale(1.05); }
.mrs-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }


.mrs-chat-fx {
  font-size: 0.65rem;
  color: #636e72;
  text-align: center;
  padding: 4px 16px 8px;
  background: #fff;
}

[dir="rtl"] .mrs-chat-panel { right: auto; left: 24px; }
[dir="rtl"] .mrs-chat-fab { right: auto; left: 24px; }

@media (max-width: 480px) {
  .mrs-chat-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 90px;
  }
  .mrs-chat-fab {
    bottom: 16px;
    right: 16px;
    padding: 0 16px 0 12px;
    height: 50px;
    font-size: 13px;
  }
  .mrs-chat-fab.open { right: 16px; width: 50px; padding: 0; }
  [dir="rtl"] .mrs-chat-fab { left: 16px; right: auto; }
  [dir="rtl"] .mrs-chat-fab.open { left: 16px; }
  .mrs-fab-label { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
}
