/* ============================================================
   Sunny Realty Chat Widget — sunny-chat.css
   ============================================================ */

/* ── Variables ── */
:root {
  --sc-navy:        #0B1220;
  --sc-navy-mid:    #0f1a2e;
  --sc-gold:        #D4AF37;
  --sc-gold-bright: #F0C840;
  --sc-blue:        #2563EB;
  --sc-white:       #ffffff;
  --sc-g100:        #f3f4f6;
  --sc-g200:        #e5e7eb;
  --sc-g400:        #9ca3af;
  --sc-g600:        #4b5563;
  --sc-green:       #4ade80;
  --sc-radius:      16px;
  --sc-shadow:      0 24px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(212,175,55,0.18);
}

/* ── Float button ── */
#sunny-float-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--sc-gold);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(212,175,55,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  outline: none;
}
#sunny-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(212,175,55,0.65);
}
#sunny-float-btn .sc-notif {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
#sunny-float-btn .sc-tooltip {
  position: absolute;
  right: 70px;
  bottom: 50%;
  transform: translateY(50%);
  background: var(--sc-navy);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-family: 'Inter', sans-serif;
}
#sunny-float-btn:hover .sc-tooltip { opacity: 1; }

/* ── Chat window ── */
#sunny-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 99999;
  width: 380px;
  max-height: 620px;
  background: #fff;
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  animation: sc-slidein 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
#sunny-chat-window.sc-open { display: flex; }
@keyframes sc-slidein {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Header ── */
.sc-header {
  background: var(--sc-navy);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212,175,55,0.15);
  flex-shrink: 0;
}
.sc-header-left { display: flex; align-items: center; gap: 11px; }
.sc-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 800; font-size: 1rem; flex-shrink: 0;
}
.sc-av-sunny  { background: linear-gradient(135deg,#D4AF37,#B8960C); color: #0B1220; }
.sc-av-alex   { background: linear-gradient(135deg,#2563EB,#1d4ed8); color: #fff; }
.sc-av-morgan { background: linear-gradient(135deg,#16a34a,#15803d); color: #fff; }
.sc-av-jordan { background: linear-gradient(135deg,#7c3aed,#6d28d9); color: #fff; }
.sc-agent-name { font-weight: 700; color: #fff; font-size: 0.9rem; }
.sc-status {
  font-size: 0.7rem; color: var(--sc-green);
  display: flex; align-items: center; gap: 4px; margin-top: 1px;
}
.sc-status-dot {
  width: 5px; height: 5px; background: var(--sc-green);
  border-radius: 50%; animation: sc-blink 2s infinite;
}
@keyframes sc-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.sc-close-btn {
  background: rgba(255,255,255,0.1); border: none; color: rgba(255,255,255,0.7);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; transition: background 0.2s;
}
.sc-close-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Agent tabs ── */
.sc-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid var(--sc-g200);
  flex-shrink: 0;
  overflow-x: auto;
}
.sc-tab {
  flex: 1; min-width: 0;
  padding: 9px 4px;
  text-align: center;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--sc-g400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
  white-space: nowrap;
  border: none;
  background: none;
  font-family: inherit;
}
.sc-tab.active { color: var(--sc-navy); border-bottom: 2px solid var(--sc-gold); background: #fff; }
.sc-tab-icon { font-size: 0.9rem; display: block; margin-bottom: 2px; }

/* ── Messages ── */
.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #fafafa;
  min-height: 260px;
  max-height: 340px;
  scroll-behavior: smooth;
}
.sc-messages::-webkit-scrollbar { width: 4px; }
.sc-messages::-webkit-scrollbar-thumb { background: var(--sc-g200); border-radius: 2px; }

.sc-msg { display: flex; gap: 7px; }
.sc-msg.user { flex-direction: row-reverse; }
.sc-bubble {
  max-width: 82%; padding: 9px 13px; border-radius: 13px;
  font-size: 0.82rem; line-height: 1.55;
}
.sc-msg.ai   .sc-bubble {
  background: #fff; color: var(--sc-navy);
  border: 1px solid var(--sc-g200);
  border-radius: 4px 13px 13px 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.sc-msg.user .sc-bubble {
  background: linear-gradient(135deg,var(--sc-blue),#1d4ed8);
  color: #fff; border-radius: 13px 4px 13px 13px;
}
.sc-msg-av {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; align-self: flex-end;
}
.sc-msg.user .sc-msg-av { background: var(--sc-g200); color: #374151; }

/* Quick replies */
.sc-qr-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.sc-qr {
  background: #fff; border: 1px solid var(--sc-gold);
  color: var(--sc-navy); padding: 4px 11px;
  border-radius: 20px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s; font-family: inherit;
}
.sc-qr:hover { background: var(--sc-gold); }

/* Typing indicator */
.sc-typing { display: flex; gap: 3px; align-items: center; padding: 2px 0; }
.sc-typing span {
  width: 6px; height: 6px; background: var(--sc-g400);
  border-radius: 50%; animation: sc-bounce 1.2s infinite;
}
.sc-typing span:nth-child(2) { animation-delay: .2s; }
.sc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes sc-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-5px)} }

/* ── GDPR consent bar ── */
.sc-consent-bar {
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  padding: 10px 14px;
  font-size: 0.73rem;
  color: var(--sc-g600);
  line-height: 1.5;
  flex-shrink: 0;
}
.sc-consent-bar a { color: var(--sc-blue); }
.sc-consent-bar label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.sc-consent-bar input { margin-top: 2px; accent-color: var(--sc-gold); flex-shrink: 0; }

/* ── Input row ── */
.sc-input-row {
  display: flex; gap: 7px;
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid var(--sc-g200);
  flex-shrink: 0;
}
.sc-input {
  flex: 1; padding: 9px 13px; border-radius: 22px;
  border: 1.5px solid var(--sc-g200);
  font-size: 0.82rem; font-family: inherit; outline: none;
  transition: border 0.18s; color: var(--sc-navy); background: #fff;
}
.sc-input:focus { border-color: var(--sc-gold); }
.sc-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--sc-gold); border: none; cursor: pointer;
  font-size: 0.9rem; display: flex; align-items: center;
  justify-content: center; transition: all 0.18s; flex-shrink: 0;
}
.sc-send:hover { background: var(--sc-gold-bright); transform: scale(1.05); }
.sc-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Powered-by footer ── */
.sc-powered {
  text-align: center; padding: 6px;
  font-size: 0.67rem; color: var(--sc-g400);
  background: #fff; border-top: 1px solid var(--sc-g100);
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  #sunny-chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
    max-height: 85vh;
  }
  #sunny-float-btn { right: 16px; bottom: 16px; }
}
