/* ===== Durai's Chatbot — Rithva Homes ===== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --rh-deep:    #000000;
  --rh-mid:     #1a1a1a;
  --rh-vivid:   #333333;
  --rh-gold:    #FDBE33;
  --rh-gold-dk: #e6a820;
  --rh-light:   #fff8e6;
  --rh-amber:   #FDBE33;
  --rh-surface: #f9f9f9;
  --rh-border:  rgba(0,0,0,0.12);
  --rh-text:    #000000;
  --rh-mid-txt: #333333;
  --rh-soft:    #666666;
  --rh-white:   #ffffff;
  --rh-shadow:  rgba(253,190,51,0.35);
  --rh-font:    'Montserrat', sans-serif;
}

/* ===== BASE FONT ===== */
#dc-widget,
#dc-widget *,
.dc-promo-bubble,
.dc-promo-bubble * {
  font-family: var(--rh-font) !important;
}

/* ===== FAB BUTTON ===== */
#dc-toggle {
  position: fixed; bottom: 26px; right: 26px;
  width: 68px; height: 68px; border-radius: 22px;
  background: linear-gradient(145deg, #000000, #2a2a2a);
  border: 2.5px solid var(--rh-gold); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 99998; overflow: visible;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 2px 8px rgba(253,190,51,0.25);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), box-shadow 0.3s, border-radius 0.4s;
  animation: dcFabEnter 0.7s cubic-bezier(.34,1.56,.64,1) 0.4s both;
}
@keyframes dcFabEnter {
  from { transform: scale(0) rotate(-90deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}
#dc-toggle:hover {
  transform: scale(1.1) rotate(-6deg);
  box-shadow: 0 16px 48px rgba(253,190,51,0.4), 0 4px 16px rgba(0,0,0,0.3);
  border-radius: 28px;
  background: linear-gradient(145deg, #111111, #333333);
}
#dc-toggle.open { border-radius: 50%; transform: rotate(45deg) scale(1.05); }
#dc-toggle svg  { width: 28px; height: 28px; fill: var(--rh-gold); position: relative; z-index: 2; transition: all 0.3s; }
#dc-toggle .dc-icon-close { display: none; }
#dc-toggle.open .dc-icon-chat  { display: none; }
#dc-toggle.open .dc-icon-close { display: block; }

.dc-fab-ring {
  position: absolute; inset: -3px; border-radius: 25px;
  border: 2px solid rgba(253,190,51,0.5); pointer-events: none; z-index: 1;
}
.dc-fab-ring-1 { animation: dcRingPulse 2.6s ease-out 0s infinite; }
.dc-fab-ring-2 { animation: dcRingPulse 2.6s ease-out 0.9s infinite; }
@keyframes dcRingPulse {
  0%  { transform: scale(1); opacity: 0.7; border-radius: 25px; }
  70% { transform: scale(1.8); opacity: 0; border-radius: 50%; }
  100%{ opacity: 0; }
}

.dc-notif-badge {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--rh-gold); border: 2px solid #000;
  font-size: 10px; font-weight: 800; color: #000;
  font-family: var(--rh-font) !important;
  display: flex; align-items: center; justify-content: center; z-index: 5;
  animation: dcBadgePop 0.4s cubic-bezier(.34,1.56,.64,1) 2.8s both;
}
@keyframes dcBadgePop { from{transform:scale(0);opacity:0} to{transform:scale(1);opacity:1} }
.dc-notif-badge.hidden { display: none; }

/* ===== PROMO BUBBLE ===== */
.dc-promo-bubble {
  position: fixed; bottom: 108px; right: 104px;
  background: var(--rh-white); border: 1.5px solid rgba(253,190,51,0.5);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 15px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.14), 0 0 0 1px rgba(253,190,51,0.15);
  font-size: 12.5px; font-weight: 600; color: #000000;
  max-width: 220px; line-height: 1.5; z-index: 99997; cursor: pointer;
  animation: dcPromoSlide 0.5s cubic-bezier(.34,1.56,.64,1) 2s both;
}
.dc-promo-bubble span { color: #000000; font-weight: 800; }
.dc-promo-bubble::after {
  content: ''; position: absolute; bottom: -7px; right: 16px;
  border: 7px solid transparent; border-top-color: #fff; border-bottom: 0;
}
@keyframes dcPromoSlide { from{opacity:0;transform:translateX(16px) scale(.88)} to{opacity:1;transform:none} }
.dc-promo-bubble.gone { animation: dcPromoOut 0.25s ease forwards; }
@keyframes dcPromoOut { to{opacity:0;transform:translateX(16px) scale(.88)} }

/* ===== WIDGET SHELL ===== */
#dc-widget {
  position: fixed; bottom: 108px; right: 26px;
  width: 385px; max-height: 650px;
  background: var(--rh-white); border-radius: 28px;
  border: 1.5px solid rgba(253,190,51,0.3);
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.1);
  z-index: 99999; overflow: hidden;
  opacity: 0; transform: scale(0.88) translateY(28px);
  transform-origin: bottom right; pointer-events: none;
  transition: opacity 0.5s cubic-bezier(.16,1,.3,1), transform 0.5s cubic-bezier(.16,1,.3,1);
}
#dc-widget.open { opacity: 1; transform: scale(1) translateY(0); pointer-events: all; }

/* ===== HEADER ===== */
.dc-header {
  background: linear-gradient(145deg, #000000 0%, #2a2a2a 100%);
  padding: 18px 18px 16px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0; position: relative; overflow: hidden;
  border-bottom: 2px solid var(--rh-gold);
}
.dc-header::after {
  content: ''; position: absolute; top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(253,190,51,0.12), transparent);
  animation: dcGlint 6s ease-in-out infinite 1s;
}
@keyframes dcGlint { 0%,100%{left:-80%} 50%{left:120%} }

.dc-avatar {
  width: 52px; height: 52px; border-radius: 16px;
  background: rgba(253,190,51,0.15); border: 1.5px solid rgba(253,190,51,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0; position: relative;
  animation: dcAvatarFloat 5s ease-in-out infinite;
}
@keyframes dcAvatarFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
.dc-status-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--rh-gold); border: 2px solid #000;
  animation: dcPulse 1.5s infinite;
}
@keyframes dcPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(0.7);opacity:0.5} }
.dc-info { flex: 1; min-width: 0; }
.dc-name { font-size: 15px; font-weight: 800; color: #FDBE33; line-height: 1.2; letter-spacing: 0.2px; }
.dc-sub  { font-size: 11.5px; color: rgba(255,255,255,0.85); margin-top: 3px; display: flex; align-items: center; gap: 5px; font-weight: 500; }
.dc-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rh-gold); box-shadow: 0 0 6px var(--rh-gold); animation: dcPulse 1.5s infinite; }
.dc-close {
  width: 36px; height: 36px; border-radius: 12px; border: none;
  background: rgba(253,190,51,0.12); cursor: pointer;
  color: var(--rh-gold); font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: all 0.25s; backdrop-filter: blur(8px);
  border: 1px solid rgba(253,190,51,0.25);
}
.dc-close:hover { background: rgba(253,190,51,0.25); transform: rotate(90deg); color: #fff; }

/* ===== PROGRESS ===== */
.dc-progress-track {
  display: flex; gap: 4px; padding: 8px 14px 6px;
  background: #f9f9f9; flex-shrink: 0;
}
.dc-prog-seg {
  flex: 1; height: 3px; border-radius: 99px;
  background: rgba(0,0,0,0.08); transition: background 0.5s;
}
.dc-prog-seg.dc-done   { background: #000000; }
.dc-prog-seg.dc-active { background: linear-gradient(90deg, #000000, var(--rh-gold)); animation: dcSegPulse 1.6s ease-in-out infinite; }
@keyframes dcSegPulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ===== MESSAGES ===== */
.dc-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f9f9f9; scroll-behavior: smooth;
}
.dc-messages::-webkit-scrollbar { width: 3px; }
.dc-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }

.dc-msg { display: flex; gap: 7px; max-width: 92%; }
.dc-msg.bot  { align-self: flex-start; animation: dcMsgInLeft  0.35s cubic-bezier(.34,1.56,.64,1); }
.dc-msg.user { align-self: flex-end; flex-direction: row-reverse; animation: dcMsgInRight 0.35s cubic-bezier(.34,1.56,.64,1); }
@keyframes dcMsgInLeft  { from{opacity:0;transform:translateX(-14px) scale(.95)} to{opacity:1;transform:none} }
@keyframes dcMsgInRight { from{opacity:0;transform:translateX(14px)  scale(.95)} to{opacity:1;transform:none} }

.dc-msg-av {
  width: 30px; height: 30px; border-radius: 10px;
  background: linear-gradient(135deg, #000000, #2a2a2a);
  border: 1.5px solid var(--rh-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; margin-top: 2px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.dc-msg-wrap { display: flex; flex-direction: column; }
.dc-msg-bubble {
  padding: 11px 14px; border-radius: 18px;
  font-size: 13.5px; line-height: 1.65; font-weight: 500;
}
.dc-msg.bot .dc-msg-bubble {
  background: var(--rh-white); border: 1px solid rgba(0,0,0,0.1);
  color: #000000; border-bottom-left-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.dc-msg.user .dc-msg-bubble {
  background: linear-gradient(135deg, #000000, #1a1a1a);
  color: #ffffff; border-bottom-right-radius: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  border: 1px solid rgba(253,190,51,0.3);
}
.dc-msg-bubble a { color: #000000; font-weight: 700; text-decoration: underline; }
.dc-msg.user .dc-msg-bubble a { color: var(--rh-gold); }
.dc-msg-time { font-size: 10px; color: #888888; margin-top: 4px; padding: 0 3px; font-weight: 500; }
.dc-msg.user .dc-msg-time { text-align: right; }

/* Typing */
.dc-typing-dots { display: flex; gap: 4px; align-items: center; padding: 4px 2px; }
.dc-typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #000000; opacity: 0.4;
  animation: dcDotBounce 1.3s ease-in-out infinite;
}
.dc-typing-dots span:nth-child(2){animation-delay:.15s}
.dc-typing-dots span:nth-child(3){animation-delay:.3s}
@keyframes dcDotBounce { 0%,80%,100%{transform:translateY(0);opacity:.4} 40%{transform:translateY(-7px);opacity:1} }

/* ===== SERVICE CARDS ===== */
.dc-svc-grid { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.dc-svc-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--rh-white); border: 1px solid rgba(0,0,0,0.1);
  transition: all 0.22s cubic-bezier(.34,1.56,.64,1);
  animation: dcCardSlide 0.3s ease both;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.dc-svc-card:nth-child(1){animation-delay:.04s}
.dc-svc-card:nth-child(2){animation-delay:.08s}
.dc-svc-card:nth-child(3){animation-delay:.12s}
.dc-svc-card:nth-child(4){animation-delay:.16s}
.dc-svc-card:nth-child(5){animation-delay:.2s}
@keyframes dcCardSlide { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.dc-svc-card:hover {
  border-color: var(--rh-gold);
  background: var(--rh-light);
  transform: translateX(6px);
  box-shadow: 0 4px 18px rgba(253,190,51,0.2);
}
.dc-svc-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all 0.22s;
  border: 1px solid rgba(0,0,0,0.08);
}
.dc-svc-card:hover .dc-svc-icon { background: var(--rh-gold); border-color: var(--rh-gold); }
.dc-svc-body { flex: 1; min-width: 0; }
.dc-svc-name { font-size: 12.5px; font-weight: 700; color: #000000; }
.dc-svc-desc { font-size: 11px; color: #444444; margin-top: 1px; line-height: 1.35; font-weight: 500; }
.dc-svc-arrow { font-size: 13px; color: #000000; font-weight: 800; transition: transform 0.2s; }
.dc-svc-card:hover .dc-svc-arrow { transform: translateX(3px); color: var(--rh-gold-dk); }

/* Stats */
.dc-stats-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; margin-top: 8px; }
.dc-stat-card {
  background: linear-gradient(135deg, #000000, #1a1a1a);
  border-radius: 12px; padding: 12px 10px; text-align: center;
  animation: dcCardSlide 0.3s ease both;
  border: 1px solid rgba(253,190,51,0.25);
}
.dc-stat-num { font-size: 17px; font-weight: 800; color: var(--rh-gold); letter-spacing: -0.5px; }
.dc-stat-lbl { font-size: 10px; color: rgba(255,255,255,0.75); margin-top: 2px; line-height: 1.3; font-weight: 600; }

/* Option buttons */
.dc-opts { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.dc-opt {
  background: var(--rh-white); border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 10px; padding: 9px 13px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: #000000;
  text-align: left; transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
  animation: dcCardSlide 0.25s ease both;
}
.dc-opt:hover {
  background: var(--rh-gold);
  border-color: var(--rh-gold-dk);
  color: #000000;
  transform: translateX(4px);
  box-shadow: 0 4px 14px rgba(253,190,51,0.3);
}

/* ===== QUICK REPLIES ===== */
.dc-quick-replies {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 8px 12px; background: #f9f9f9;
  border-top: 1px solid rgba(0,0,0,0.08); flex-shrink: 0;
}
.dc-qr {
  background: var(--rh-white); border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 100px; padding: 6px 13px;
  font-size: 11.5px; font-weight: 600; color: #000000;
  cursor: pointer; transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
  animation: dcQrPop 0.2s ease both;
}
@keyframes dcQrPop { from{opacity:0;transform:scale(.85)} to{opacity:1;transform:scale(1)} }
.dc-qr:hover {
  background: var(--rh-gold);
  border-color: var(--rh-gold-dk);
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(253,190,51,0.35);
}

/* ===== INPUT ===== */
.dc-input-hint { font-size: 11px; color: #dc2626; padding: 2px 14px 0; display: none; background: var(--rh-white); flex-shrink: 0; font-weight: 600; }
.dc-input-wrap {
  display: flex; gap: 7px; align-items: flex-end;
  padding: 10px 11px; background: var(--rh-white);
  border-top: 1px solid rgba(0,0,0,0.08); flex-shrink: 0;
}
#dc-input {
  flex: 1; background: #f9f9f9;
  border: 1.5px solid rgba(0,0,0,0.12); border-radius: 14px;
  color: #000000; font-family: var(--rh-font) !important;
  font-size: 13px; font-weight: 500; padding: 10px 13px; resize: none;
  outline: none; min-height: 42px; max-height: 96px;
  transition: border-color .25s, box-shadow .25s; line-height: 1.5;
}
#dc-input::placeholder { color: #888888; font-weight: 400; }
#dc-input:focus { border-color: var(--rh-gold); box-shadow: 0 0 0 3px rgba(253,190,51,0.18); background: #fff; }
#dc-send {
  width: 57px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, #000000, #1a1a1a);
  border: 1.5px solid var(--rh-gold); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
}
#dc-send:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 6px 22px rgba(253,190,51,0.4);
  background: var(--rh-gold);
  border-color: var(--rh-gold-dk);
}
#dc-send:hover svg { fill: #000000; }
#dc-send:active { transform: scale(.93); }
#dc-send:disabled { opacity: .35; cursor: not-allowed; transform: none; }
#dc-send svg { width: 17px; height: 17px; fill: var(--rh-gold); transition: fill 0.2s; }
.dc-privacy { font-size: 10px; color: #888888; text-align: center; padding: 5px 14px 9px; background: var(--rh-white); flex-shrink: 0; font-weight: 500; }

/* ===== RESPONSIVE ===== */
@media (max-width: 430px) {
  #dc-widget { width: calc(100vw - 14px); right: 7px; bottom: 102px; }
  #dc-toggle { right: 14px; bottom: 14px; }
  .dc-promo-bubble { right: 82px; max-width: 180px; }
}