/* ==========================================================================
   YUPPCAD LIVE SUPPORT CHAT — FLOATING WIDGET & DIALOG MODAL
   Designed to seamlessly match YuppCAD Luxury Industrial Obsidian Theme
   ========================================================================== */

/* 1. FLOATING ACTION BUTTON (FAB) */
.yupp-support-fab {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 50%, #e63946 100%);
  background-size: 200% 200%;
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.45), 0 0 15px rgba(230, 57, 70, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99990;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  padding: 0;
  color: #ffffff;
  user-select: none;
  animation: yuppFabGradient 6s ease infinite;
}

@keyframes yuppFabGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.yupp-support-fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 35px rgba(14, 165, 233, 0.6), 0 0 25px rgba(230, 57, 70, 0.5);
  border-color: rgba(255, 255, 255, 0.6);
}

.yupp-support-fab:active {
  transform: scale(0.96);
}

.yupp-support-fab svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.yupp-support-fab.open svg.icon-chat {
  display: none;
}
.yupp-support-fab.open svg.icon-close {
  display: block;
}
.yupp-support-fab svg.icon-close {
  display: none;
}

/* Online Pulse Dot */
.yupp-fab-online-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border: 2px solid #080a0f;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.yupp-fab-online-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: yuppPulseRadar 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes yuppPulseRadar {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Unread Badge */
.yupp-fab-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: #e63946;
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #080a0f;
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.7);
  animation: yuppPopBadge 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.yupp-fab-badge.visible {
  display: flex;
}

@keyframes yuppPopBadge {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* Tooltip on hover */
.yupp-fab-tooltip {
  position: absolute;
  right: 74px;
  background: rgba(15, 18, 26, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  letter-spacing: 0.3px;
}

.yupp-support-fab:hover .yupp-fab-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* 2. CHAT WIDGET WINDOW */
.yupp-chat-widget {
  position: fixed;
  bottom: 96px;
  right: 26px;
  width: 440px;
  max-width: calc(100vw - 32px);
  height: 640px;
  max-height: calc(100vh - 110px);
  background: rgba(11, 14, 21, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(14, 165, 233, 0.18);
  display: none;
  flex-direction: column;
  z-index: 99990;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  -webkit-hyphens: none !important;
  hyphens: none !important;
}

.yupp-chat-widget.active {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Avoid FAB tooltip overlap when chat is open */
.yupp-support-fab.open .yupp-fab-tooltip {
  display: none !important;
}

/* Drag and drop overlay */
.yupp-chat-drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 21, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.yupp-chat-widget.drag-active .yupp-chat-drag-overlay {
  display: flex;
}

.yupp-chat-drag-box {
  border: 2px dashed #0ea5e9;
  border-radius: 16px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.08);
  text-align: center;
  padding: 16px;
  box-shadow: inset 0 0 25px rgba(14, 165, 233, 0.2);
}

/* Chat Header */
.yupp-chat-header {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  gap: 8px;
}

.yupp-chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.6), transparent);
}

.yupp-chat-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.yupp-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  position: relative;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
}

.yupp-chat-avatar img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.yupp-chat-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #0f172a;
  border-radius: 50%;
}

.yupp-chat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.yupp-chat-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yupp-chat-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.yupp-chat-sub span.live {
  color: #10b981;
  font-weight: 600;
}

.yupp-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.yupp-chat-btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.yupp-chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateY(-1px);
}

/* User Contact Drawer (optional bar) */
.yupp-chat-contact-bar {
  background: rgba(14, 165, 233, 0.08);
  border-bottom: 1px solid rgba(14, 165, 233, 0.2);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #bae6fd;
}

.yupp-chat-contact-bar a {
  color: #38bdf8;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.yupp-chat-contact-form {
  display: none;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  gap: 8px;
}

.yupp-chat-contact-form.open {
  display: flex;
  flex-direction: column;
}

.yupp-chat-contact-form input {
  background: #080a0f;
  border: 1px solid #1e2230;
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-size: 0.78rem;
  outline: none;
}

.yupp-chat-contact-form input:focus {
  border-color: #0ea5e9;
}

/* Chat Messages Area */
.yupp-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  background: radial-gradient(circle at 50% 10%, rgba(14, 165, 233, 0.04), transparent 70%);
}

.yupp-chat-body::-webkit-scrollbar {
  width: 5px;
}

.yupp-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Date separator */
.yupp-chat-date-divider {
  text-align: center;
  margin: 6px 0;
  font-size: 0.68rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

/* Message Rows */
.yupp-chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: yuppMsgAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes yuppMsgAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.yupp-chat-msg-row.bot,
.yupp-chat-msg-row.admin {
  align-self: flex-start;
}

.yupp-chat-msg-row.client {
  align-self: flex-end;
}

.yupp-chat-sender-label {
  font-size: 0.68rem;
  color: #64748b;
  margin-bottom: 3px;
  padding: 0 4px;
}

.yupp-chat-msg-row.client .yupp-chat-sender-label {
  text-align: right;
  color: #38bdf8;
}

.yupp-chat-bubble {
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: 14px;
  word-break: break-word;
  overflow-wrap: anywhere;
  position: relative;
}

.yupp-chat-bubble.media-only {
  padding: 4px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.yupp-chat-bubble.media-only .yupp-chat-attachments {
  margin-top: 0;
}

.yupp-chat-text {
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}

.yupp-chat-text:not(:last-child) {
  margin-bottom: 8px;
}

.yupp-chat-msg-row.bot .yupp-chat-bubble,
.yupp-chat-msg-row.admin .yupp-chat-bubble {
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.yupp-chat-msg-row.client .yupp-chat-bubble {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.yupp-chat-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 4px;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}

.yupp-msg-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}

.yupp-msg-check.sent {
  color: #94a3b8;
}

.yupp-msg-check.read {
  color: #38bdf8;
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.5));
}

.yupp-msg-check.sending {
  color: rgba(255, 255, 255, 0.45);
  animation: yuppSpinClock 2s linear infinite;
}

@keyframes yuppSpinClock {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.yupp-check-svg {
  display: block;
  overflow: visible;
}

.yupp-chat-msg-row.bot .yupp-chat-meta,
.yupp-chat-msg-row.admin .yupp-chat-meta {
  justify-content: flex-start;
  color: #64748b;
}

/* Attachment cards rendered inside messages */
.yupp-chat-attachments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-width: 100%;
}

/* 1. Rich Image/Media Card */
.yupp-chat-media-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  max-width: 280px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.yupp-chat-media-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.yupp-media-preview-wrap {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: block;
}

.yupp-media-img-link {
  display: block;
  position: relative;
  text-decoration: none;
  cursor: zoom-in;
}

.yupp-media-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.yupp-media-img-link:hover .yupp-media-img {
  transform: scale(1.025);
  filter: brightness(1.05);
}

.yupp-media-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 60%);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.yupp-media-img-link:hover .yupp-media-hover-overlay {
  opacity: 1;
}

.yupp-media-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.yupp-media-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yupp-media-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yupp-media-meta {
  font-size: 0.66rem;
  color: #94a3b8;
}

.yupp-media-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.yupp-media-dl-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  transform: scale(1.08);
}

.yupp-media-dl-btn.sending {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Fallback if image fails to load */
.yupp-chat-media-item.img-fallback .yupp-media-preview-wrap {
  display: none;
}
.yupp-chat-media-item.img-fallback .yupp-media-info-bar {
  border-top: none;
}

/* 2. Sleek CAD & Document File Card */
.yupp-chat-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  max-width: 290px;
  transition: all 0.2s ease;
}

.yupp-chat-file-item:hover {
  background: rgba(20, 30, 52, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.yupp-chat-file-item.dxf {
  border-color: rgba(14, 165, 233, 0.35);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.yupp-file-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yupp-file-icon-box.dxf {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.45);
}

.yupp-file-icon-box.doc {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.yupp-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yupp-file-name {
  font-size: 0.77rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yupp-file-meta {
  font-size: 0.67rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.yupp-badge-dxf {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.45);
}

.yupp-badge-doc {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.yupp-file-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.yupp-file-dl-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  transform: scale(1.08);
}

.yupp-file-dl-btn.sending {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Spinner helper */
.spin {
  animation: yuppSpinClock 1.4s linear infinite;
}

/* Legacy fallback classes */
.yupp-att-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
}
.yupp-att-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.yupp-att-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.yupp-att-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yupp-att-meta {
  font-size: 0.68rem;
  color: #94a3b8;
}
.yupp-att-dl-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  text-decoration: none;
}

/* Quick Action Chips (Natural, human tags instead of bot menu) */
.yupp-chat-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.yupp-chat-chips-label {
  font-size: 0.68rem;
  color: #64748b;
  margin-left: 2px;
  font-weight: 500;
}

.yupp-chat-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yupp-chat-chip-btn {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.22);
  color: #93c5fd;
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.yupp-chat-chip-btn:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25);
}

.yupp-chat-chip-btn:active {
  transform: translateY(0);
}

/* Typing Indicator (inside messages flow with clean margins) */
.yupp-chat-typing {
  display: none;
  align-self: flex-start;
  background: #141824;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 14px;
  gap: 4px;
  align-items: center;
  margin: 4px 0;
}

.yupp-chat-typing.active {
  display: flex;
}

.yupp-chat-typing span {
  width: 6px;
  height: 6px;
  background: #0ea5e9;
  border-radius: 50%;
  animation: yuppTypingDots 1.4s infinite ease-in-out both;
}

.yupp-chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.yupp-chat-typing span:nth-child(2) { animation-delay: -0.16s; }
.yupp-chat-typing span:nth-child(3) { animation-delay: 0s; }

@keyframes yuppTypingDots {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Chat Footer & Input (Comfortable Height + Attachment Bar) */
.yupp-chat-footer {
  background: #0d111a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  flex-shrink: 0;
}

.yupp-chat-input-container {
  background: #080a0f;
  border: 1px solid #1e2230;
  border-radius: 14px;
  padding: 8px 10px 8px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yupp-chat-input-container:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.25);
}

/* Pending attachments tray */
.yupp-chat-pending-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 85px;
  overflow-y: auto;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.yupp-pending-chip {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #bae6fd;
  max-width: 100%;
}

.yupp-pending-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: #0284c7;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
}

.yupp-pending-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.yupp-pending-remove {
  cursor: pointer;
  color: #94a3b8;
  font-weight: bold;
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.15s;
  padding: 0 2px;
}

.yupp-pending-remove:hover {
  color: #f87171;
}

/* Textarea (Comfortable Height!) */
.yupp-chat-textarea {
  width: 100%;
  min-height: 48px;
  height: 52px;
  max-height: 130px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.86rem;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.45;
  padding: 2px 0;
  scrollbar-width: thin;
}

.yupp-chat-textarea::placeholder {
  color: #64748b;
  font-size: 0.82rem;
}

/* Actions row */
.yupp-chat-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.yupp-chat-input-left-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.yupp-chat-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 8px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.74rem;
  font-family: inherit;
}

.yupp-chat-tool-btn:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

.yupp-chat-tool-btn:active {
  transform: scale(0.96);
}

.yupp-chat-send-btn {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.yupp-chat-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

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

.yupp-chat-send-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.yupp-chat-brand-note {
  font-size: 0.65rem;
  color: #475569;
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.2px;
}

.yupp-chat-brand-note:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 3. MOBILE RESPONSIVENESS */
@media (max-width: 640px) {
  .yupp-support-fab {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
  .yupp-support-fab svg {
    width: 22px;
    height: 22px;
  }
  .yupp-fab-online-dot {
    width: 12px;
    height: 12px;
    top: 2px;
    right: 2px;
  }
}

@media (max-width: 480px) {
  .yupp-chat-widget {
    bottom: 74px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    height: calc(100vh - 88px);
    max-height: none;
    border-radius: 14px;
  }
  .yupp-attach-label {
    display: none;
  }
  .yupp-chat-tool-btn {
    padding: 0 8px;
    width: 32px;
    justify-content: center;
  }
}

/* 4. MODAL & BANNER OVERLAP SUPPRESSION */
body.modal-open .yupp-support-fab,
body.cookie-banner-active .yupp-support-fab,
body:has(.modal-overlay.active) .yupp-support-fab,
body:has(#enterpriseModal.active) .yupp-support-fab,
body:has(#checkoutModal.active) .yupp-support-fab,
body:has(#secure3dsModal.active) .yupp-support-fab,
body:has(#videoModal.active) .yupp-support-fab,
body:has(#activateLicenseModal.active) .yupp-support-fab,
.modal-overlay.active ~ .yupp-support-fab,
.modal-overlay.active + .yupp-support-fab {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(0.3) !important;
  visibility: hidden !important;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

@media (max-width: 768px) {
  body:has(.cookie-banner.show) .yupp-support-fab,
  .cookie-banner.show ~ .yupp-support-fab {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(0.3) !important;
    visibility: hidden !important;
  }
  body:has(input:focus) .yupp-support-fab,
  body:has(textarea:focus) .yupp-support-fab {
    opacity: 0.15;
    pointer-events: none;
    transform: scale(0.75);
  }
}
