/* =========================================================
   Rent-A-Bay — Chat Widget Styles
   ========================================================= */

/* ── Toggle Button ──────────────────────────────────────── */
.rab-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f5c518;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(245, 197, 24, 0.45), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #0a1628;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.rab-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(245, 197, 24, 0.6), 0 2px 12px rgba(0,0,0,0.35);
}

.rab-chat-toggle:active {
  transform: scale(0.96);
}

/* Icon swap open/close */
.rab-icon-chat { display: block; transition: opacity 0.2s, transform 0.2s; }
.rab-icon-close { display: none; opacity: 0; transform: rotate(-90deg); transition: opacity 0.2s, transform 0.2s; }

.rab-chat-toggle.is-open .rab-icon-chat  { display: none; opacity: 0; }
.rab-chat-toggle.is-open .rab-icon-close { display: block; opacity: 1; transform: rotate(0deg); }

/* Badge */
.rab-chat-badge {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8321a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  border: 2px solid #0a1628;
  animation: rab-badge-pulse 2s ease-in-out infinite;
}

@keyframes rab-badge-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

/* ── Chat Panel ─────────────────────────────────────────── */
.rab-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: 560px;
  background: #0f1f3d;
  border: 1px solid rgba(245,197,24,0.2);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,197,24,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rab-panel-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}

@keyframes rab-panel-in {
  from { opacity: 0; transform: scale(0.85) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes rab-panel-out {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.85) translateY(12px); }
}

.rab-panel-closing {
  animation: rab-panel-out 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ── Header ─────────────────────────────────────────────── */
.rab-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0a1628 0%, #0f1f3d 100%);
  border-bottom: 1px solid rgba(245,197,24,0.15);
  flex-shrink: 0;
}

.rab-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rab-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(245,197,24,0.15);
  border: 2px solid rgba(245,197,24,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5c518;
  flex-shrink: 0;
}

.rab-chat-name {
  font-weight: 700;
  font-size: 14px;
  color: #f0f2f8;
  margin: 0;
  line-height: 1.2;
}

.rab-chat-status {
  font-size: 11px;
  color: #a0aec0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0 0;
}

.rab-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48bb78;
  display: inline-block;
  box-shadow: 0 0 6px #48bb78;
  animation: rab-status-pulse 2.5s ease-in-out infinite;
}

@keyframes rab-status-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.rab-chat-close-btn {
  background: rgba(255,255,255,0.07);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
  transition: background 0.15s, color 0.15s;
}

.rab-chat-close-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #f0f2f8;
}

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

.rab-chat-messages::-webkit-scrollbar { width: 4px; }
.rab-chat-messages::-webkit-scrollbar-track { background: transparent; }
.rab-chat-messages::-webkit-scrollbar-thumb { background: rgba(245,197,24,0.2); border-radius: 2px; }

.rab-msg {
  display: flex;
  max-width: 90%;
}

.rab-msg-bot  { align-self: flex-start; }
.rab-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.rab-msg-bubble {
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #e8edf5;
}

.rab-msg-bot .rab-msg-bubble {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}

.rab-msg-user .rab-msg-bubble {
  background: #f5c518;
  color: #0a1628;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.rab-msg-bubble a {
  color: #f5c518;
  font-weight: 600;
  text-decoration: none;
}

.rab-msg-bubble a:hover {
  text-decoration: underline;
}

/* Typing indicator */
.rab-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
}

.rab-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(245,197,24,0.5);
  display: inline-block;
  animation: rab-typing-bounce 1.2s ease-in-out infinite;
}

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

@keyframes rab-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Quick Suggestions ──────────────────────────────────── */
.rab-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.rab-suggestion {
  background: rgba(245,197,24,0.1);
  border: 1px solid rgba(245,197,24,0.3);
  color: #f5c518;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.rab-suggestion:hover {
  background: rgba(245,197,24,0.2);
  border-color: rgba(245,197,24,0.6);
}

/* ── Input Area ─────────────────────────────────────────── */
.rab-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(10,22,40,0.6);
  flex-shrink: 0;
}

.rab-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: #f0f2f8;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.rab-chat-input::placeholder { color: #6b7a99; }

.rab-chat-input:focus {
  border-color: rgba(245,197,24,0.5);
  background: rgba(255,255,255,0.1);
}

.rab-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5c518;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a1628;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.rab-chat-send:hover {
  background: #ffd700;
  transform: scale(1.08);
}

.rab-chat-send:active {
  transform: scale(0.94);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .rab-chat-toggle {
    bottom: 18px;
    right: 18px;
  }

  .rab-chat-panel {
    width: calc(100vw - 36px);
    right: 18px;
    bottom: 88px;
    max-height: 70vh;
  }
}
