/* ==========================================================================
   UNIVERSAL FURNITURE — BESPOKE CONVERSATIONAL LEAD & CHAT WIDGET
   Inspired by Estre India | Tailored for Universal Furniture Bengaluru
   ========================================================================== */

:root {
  --uf-chat-primary: #C59B27;
  --uf-chat-primary-hover: #D8AA2C;
  --uf-chat-primary-dark: #A37E1C;
  --uf-chat-dark: #14181D;
  --uf-chat-dark-light: #1F242C;
  --uf-chat-bg: #FAF8F5;
  --uf-chat-bot-bubble: #FFFFFF;
  --uf-chat-bot-text: #22252A;
  --uf-chat-user-bubble: #C59B27;
  --uf-chat-user-text: #FFFFFF;
  --uf-chat-border: #E8E3DA;
  --uf-chat-radius: 18px;
  --uf-chat-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Floating Chat Trigger Button (Stacked cleanly above Cart Button)
   -------------------------------------------------------------------------- */
#uf-chat-trigger-wrap {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  pointer-events: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Floating Greeting Pill / Tooltip */
.uf-chat-pill {
  position: relative;
  background: #1A1E24;
  color: #FFFFFF;
  padding: 8px 14px 8px 14px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border: 1px solid rgba(197, 155, 39, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  animation: ufPillFloat 3s ease-in-out infinite alternate;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.uf-chat-pill:hover {
  transform: scale(1.03);
  border-color: var(--uf-chat-primary);
  box-shadow: 0 10px 28px rgba(197, 155, 39, 0.3);
}

.uf-chat-pill-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.uf-chat-pill-sparkle {
  color: var(--uf-chat-primary);
  font-size: 14px;
}

.uf-chat-pill-close {
  background: none;
  border: none;
  color: #8E98A5;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 0 4px;
  display: flex;
  align-items: center;
  line-height: 1;
}

.uf-chat-pill-close:hover {
  color: #FFFFFF;
}

@keyframes ufPillFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

/* Circular Trigger Button */
.uf-chat-trigger-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1A1E24 0%, #2D343F 100%);
  border: 2px solid var(--uf-chat-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(197, 155, 39, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
  padding: 0;
}

.uf-chat-trigger-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(197, 155, 39, 0.45);
  border-color: #F3C343;
}

.uf-chat-trigger-btn:active {
  transform: scale(0.96);
}

/* Pulsing Outer Ring */
.uf-chat-trigger-btn::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--uf-chat-primary);
  opacity: 0;
  animation: ufPulseRing 2.4s infinite;
  pointer-events: none;
}

@keyframes ufPulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

.uf-chat-icon-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.uf-chat-logo-monogram {
  font-family: "Cinzel", "Playfair Display", Georgia, serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--uf-chat-primary);
  letter-spacing: -0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  line-height: 1;
}

.uf-chat-close-icon {
  display: none;
  width: 20px;
  height: 20px;
  color: #FFFFFF;
}

#uf-chat-trigger-wrap.is-open .uf-chat-logo-monogram {
  display: none;
}

#uf-chat-trigger-wrap.is-open .uf-chat-close-icon {
  display: block;
}

#uf-chat-trigger-wrap.is-open .uf-chat-pill {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Chat Modal Window
   -------------------------------------------------------------------------- */
#uf-chat-modal {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--uf-chat-bg);
  border-radius: var(--uf-chat-radius);
  box-shadow: var(--uf-chat-shadow);
  border: 1px solid rgba(197, 155, 39, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.94);
  transform-origin: bottom right;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#uf-chat-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.uf-cm-header {
  background: linear-gradient(135deg, #181C22 0%, #111418 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(197, 155, 39, 0.2);
  color: #FFFFFF;
}

.uf-cm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.uf-cm-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #232830;
  border: 2px solid var(--uf-chat-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.uf-cm-avatar span {
  font-family: "Cinzel", "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--uf-chat-primary);
}

.uf-cm-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #181C22;
}

.uf-cm-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.uf-cm-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.uf-cm-verified {
  color: var(--uf-chat-primary);
  font-size: 13px;
}

.uf-cm-subtitle {
  font-size: 12px;
  color: #9CA3AF;
  font-weight: 400;
}

.uf-cm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.uf-cm-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #D1D5DB;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.uf-cm-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  border-color: var(--uf-chat-primary);
}

/* Chat Body (Messages Area) */
.uf-cm-body {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FAF8F5;
  scroll-behavior: smooth;
}

.uf-cm-body::-webkit-scrollbar {
  width: 5px;
}
.uf-cm-body::-webkit-scrollbar-thumb {
  background: #D9D2C5;
  border-radius: 4px;
}

/* Message Rows */
.uf-msg-row {
  display: flex;
  gap: 8px;
  animation: ufMsgAppear 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ufMsgAppear {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.uf-msg-row.bot {
  align-items: flex-start;
}

.uf-msg-row.user {
  justify-content: flex-end;
}

.uf-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1E232A;
  border: 1px solid var(--uf-chat-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--uf-chat-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Bubbles */
.uf-bubble {
  max-width: 82%;
  padding: 12px 15px;
  font-size: 13.5px;
  line-height: 1.48;
  position: relative;
  word-wrap: break-word;
}

.uf-msg-row.bot .uf-bubble {
  background: #FFFFFF;
  color: var(--uf-chat-bot-text);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #EAE5DB;
}

.uf-msg-row.user .uf-bubble {
  background: linear-gradient(135deg, #C59B27 0%, #B2881E 100%);
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.28);
  font-weight: 500;
}

.uf-bubble p {
  margin: 0 0 6px 0;
}
.uf-bubble p:last-child {
  margin-bottom: 0;
}

.uf-bubble strong {
  color: #111418;
  font-weight: 700;
}
.uf-msg-row.user .uf-bubble strong {
  color: #FFFFFF;
}

.uf-msg-time {
  font-size: 10px;
  color: #9CA3AF;
  margin-top: 4px;
  display: block;
  text-align: right;
}
.uf-msg-row.user .uf-msg-time {
  color: rgba(255, 255, 255, 0.75);
}

/* Typing Indicator */
.uf-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #FFFFFF;
  border-radius: 16px 16px 16px 4px;
  border: 1px solid #EAE5DB;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  width: fit-content;
}

.uf-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9CA3AF;
  animation: ufWave 1.4s infinite ease-in-out;
}

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

@keyframes ufWave {
  0%, 60%, 100% { transform: translateY(0); background: #9CA3AF; }
  30% { transform: translateY(-5px); background: var(--uf-chat-primary); }
}

/* Choice Chips Container */
.uf-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  animation: ufMsgAppear 0.3s ease;
}

.uf-chip {
  background: #FFFFFF;
  border: 1px solid #D9D2C5;
  color: #2D343F;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.uf-chip:hover {
  background: #FAF5E8;
  border-color: var(--uf-chat-primary);
  color: #A37E1C;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(197, 155, 39, 0.18);
}

.uf-chip:active {
  transform: scale(0.97);
}

.uf-chip.selected {
  background: var(--uf-chat-primary);
  color: #FFFFFF;
  border-color: var(--uf-chat-primary);
}

/* Action Cards Screen (Final Step) */
.uf-action-card-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
}

.uf-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  outline: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.uf-card-btn-wa {
  background: linear-gradient(135deg, #25D366 0%, #1EBE5D 100%);
  color: #FFFFFF !important;
}

.uf-card-btn-wa:hover {
  background: linear-gradient(135deg, #1EBE5D 0%, #16A34A 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.uf-card-btn-call {
  background: linear-gradient(135deg, #1A1E24 0%, #2D343F 100%);
  color: #FFFFFF !important;
  border: 1px solid rgba(197, 155, 39, 0.4);
}

.uf-card-btn-call:hover {
  background: #111418;
  border-color: var(--uf-chat-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.uf-card-btn-visit {
  background: #FFFFFF;
  color: #2D343F !important;
  border: 1px solid #D9D2C5;
}

.uf-card-btn-visit:hover {
  border-color: var(--uf-chat-primary);
  background: #FDFBF7;
  transform: translateY(-2px);
}

.uf-card-btn-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.uf-card-btn-inner svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.uf-card-btn-sub {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
  display: block;
}

/* Chat Footer / Input Area */
.uf-cm-footer {
  padding: 12px 14px;
  background: #FFFFFF;
  border-top: 1px solid #EAE5DB;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uf-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F4F2EB;
  border: 1px solid #E0DAD0;
  border-radius: 24px;
  padding: 4px 6px 4px 14px;
  transition: all 0.2s;
}

.uf-input-row:focus-within {
  background: #FFFFFF;
  border-color: var(--uf-chat-primary);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

.uf-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 13.5px;
  color: #1F242C;
  outline: none;
  font-family: inherit;
}

.uf-chat-input::placeholder {
  color: #9CA3AF;
}

.uf-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--uf-chat-primary);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.uf-send-btn:hover {
  background: var(--uf-chat-primary-hover);
  transform: scale(1.05);
}

.uf-send-btn:active {
  transform: scale(0.95);
}

.uf-send-btn:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
  transform: none;
}

.uf-send-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  margin-left: 2px;
}

.uf-footer-note {
  font-size: 10.5px;
  color: #9CA3AF;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   Mobile View Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  #uf-chat-trigger-wrap {
    bottom: 86px;
    right: 18px;
  }
  
  .uf-chat-trigger-btn {
    width: 52px;
    height: 52px;
  }

  .uf-chat-logo-monogram {
    font-size: 21px;
  }

  .uf-chat-pill {
    padding: 6px 12px;
    font-size: 12px;
  }

  #uf-chat-modal {
    bottom: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 88vh !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    border: none !important;
  }

  .uf-cm-header {
    padding: 14px 16px;
    border-radius: 20px 20px 0 0;
  }
}
