/* ============================================================
   DDEXCH Real-Time Live Support Chat Widget Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600;1,700&display=swap');

:root {
  --dd-chat-gold: #F59E0B;
  --dd-chat-gold-glow: rgba(245, 158, 11, 0.4);
  --dd-chat-bg: #0F172A;
  --dd-chat-card: #1E293B;
  --dd-chat-card-border: rgba(255, 255, 255, 0.08);
  --dd-chat-text: #F8FAFC;
  --dd-chat-muted: #94A3B8;
  --dd-chat-bubble-admin: #1E293B;
  --dd-chat-bubble-user: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --dd-chat-font: "Source Sans 3", sans-serif;
}

.dd-chat-container,
.dd-chat-widget-window,
.dd-chat-widget-window *:not(i):not(.fas):not(.far):not(.fab):not(.fa) {
  font-family: var(--dd-chat-font) !important;
}

/* Floating Chat Trigger Button */
.dd-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #000000;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.45), 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 2147483640;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  user-select: none;
}

.dd-chat-trigger i,
.dd-chat-trigger .fas,
#ddChatIcon {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-size: 24px !important;
  line-height: 1 !important;
  display: inline-block !important;
  color: #000000 !important;
}

#ddChatIcon::before,
.dd-chat-trigger .fa-comments::before {
  content: "\f086" !important;
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  display: inline-block !important;
}

.dd-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(217, 119, 6, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
}

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

/* Position adjustment if WhatsApp button is bottom-right */
body.has-wa-right .dd-chat-trigger {
  bottom: 92px;
}

/* Unread Badge */
.dd-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #FFFFFF;
  font-family: var(--dd-chat-font);
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0F172A;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
  animation: ddBadgePulse 2s infinite;
}

@keyframes ddBadgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Chat Main Window */
.dd-chat-widget-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #0B1120;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483641;
  font-family: var(--dd-chat-font);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dd-chat-widget-window:not(.open) {
  display: none !important;
}

.dd-chat-widget-window.open {
  display: flex !important;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

body.has-wa-right .dd-chat-widget-window {
  bottom: 164px;
}

/* Chat Header */
.dd-chat-header {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dd-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.dd-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B 0%, #B45309 100%);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  position: relative;
}

.dd-chat-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #0F172A;
}

.dd-chat-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dd-chat-title {
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-chat-subtitle {
  color: #10B981;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.dd-chat-header-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #CBD5E1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.dd-chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

/* Close button — prominently colored so it's unmissable */
#ddChatCloseBtn {
  background: rgba(239, 68, 68, 0.18);
  border: 1.5px solid rgba(239, 68, 68, 0.55);
  color: #EF4444;
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

#ddChatCloseBtn:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
  transform: scale(1.08);
}

#ddChatCloseBtn:active {
  transform: scale(0.94);
}

/* Chat Body / Messages Area */
.dd-chat-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.5) 0%, rgba(11, 17, 32, 0.8) 100%);
  scroll-behavior: smooth;
}

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

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

/* Date / Status Dividers */
.dd-chat-divider {
  text-align: center;
  margin: 6px 0;
  position: relative;
}

.dd-chat-divider span {
  background: #1E293B;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Message Rows & Bubbles */
.dd-chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: ddMsgIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.dd-chat-msg-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.dd-chat-msg-row.admin {
  align-self: flex-start;
  align-items: flex-start;
}

.dd-chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.dd-chat-msg-row.admin .dd-chat-bubble {
  background: #1E293B;
  color: #F8FAFC;
  border-bottom-left-radius: 3px;
  border: 1px solid rgba(245, 158, 11, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dd-chat-msg-row.user .dd-chat-bubble {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #000000;
  font-weight: 500;
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.dd-chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #64748B;
  margin-top: 4px;
  padding: 0 4px;
}

.dd-chat-msg-row.user .dd-chat-msg-meta {
  color: #94A3B8;
}

.dd-chat-sender-tag {
  font-weight: 700;
  color: #F59E0B;
}

/* Typing Indicator Animation */
.dd-chat-typing {
  align-self: flex-start;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 12px;
  display: none;
  align-items: center;
  gap: 4px;
}

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

.dd-chat-dot {
  width: 6px;
  height: 6px;
  background: #F59E0B;
  border-radius: 50%;
  animation: ddTypingBounce 1.4s infinite ease-in-out both;
}

.dd-chat-dot:nth-child(1) { animation-delay: -0.32s; }
.dd-chat-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* User Identity Banner (Secure & Unchangeable) */
.dd-chat-user-banner {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.dd-chat-user-banner.verified {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.dd-chat-user-banner.visitor {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.dd-chat-user-banner-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #F8FAFC;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-chat-user-banner.verified .dd-chat-user-banner-left i {
  color: #10B981;
}

.dd-chat-user-banner.visitor .dd-chat-user-banner-left i {
  color: #94A3B8;
}

.dd-chat-user-banner-tag {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #F59E0B;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Footer / Input Bar */
.dd-chat-footer {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  background: #1E293B;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dd-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  background: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 9px 14px;
  color: #FFFFFF;
  font-family: var(--dd-chat-font);
  font-size: 13px;
  outline: none;
  resize: none;
  max-height: 80px;
  transition: border-color 0.2s;
}

.dd-chat-input:focus {
  border-color: #F59E0B;
}

.dd-chat-input::placeholder {
  color: #64748B;
}

.dd-chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s;
  outline: none;
}

.dd-chat-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.dd-chat-send-btn:active {
  transform: scale(0.92);
}

.dd-chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Voice Message Controls & Recording */
.dd-chat-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s;
  outline: none;
}

.dd-chat-mic-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #F59E0B;
  transform: scale(1.08);
}

.dd-chat-mic-btn:active {
  transform: scale(0.92);
}

.dd-chat-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.2s;
  outline: none;
}

.dd-chat-attach-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #F59E0B;
  transform: scale(1.08);
}

.dd-chat-attach-btn:active {
  transform: scale(0.92);
}

.dd-chat-attach-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dd-chat-recording-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #0F172A;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 20px;
  padding: 6px 12px;
  box-sizing: border-box;
  animation: ddRecFadeIn 0.2s ease;
}

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

.dd-rec-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: ddPulse 1.4s infinite;
  flex-shrink: 0;
}

@keyframes ddPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.dd-rec-status {
  font-size: 11px;
  font-weight: 600;
  color: #EF4444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dd-rec-timer {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  font-family: monospace, var(--dd-chat-font);
  flex: 1;
}

.dd-rec-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dd-rec-btn {
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  outline: none;
}

.dd-rec-btn.cancel {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.dd-rec-btn.cancel:hover {
  background: #EF4444;
  color: #FFFFFF;
  transform: scale(1.08);
}

.dd-rec-btn.send {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.dd-rec-btn.send:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.5);
}

.dd-rec-btn:active {
  transform: scale(0.92);
}

/* Voice Message Player Bubble */
.dd-voice-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  max-width: 280px;
  padding: 4px 2px;
  user-select: none;
}

.dd-voice-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.2s;
  outline: none;
}

.dd-chat-msg-row.user .dd-voice-play-btn {
  background: rgba(0, 0, 0, 0.78);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.dd-chat-msg-row.user .dd-voice-play-btn:hover {
  background: #000000;
  transform: scale(1.08);
}

.dd-chat-msg-row.admin .dd-voice-play-btn {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #000000;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.dd-chat-msg-row.admin .dd-voice-play-btn:hover {
  transform: scale(1.08);
}

.dd-voice-waveform-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dd-voice-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.dd-chat-msg-row.user .dd-voice-track {
  background: rgba(0, 0, 0, 0.2);
}

.dd-chat-msg-row.admin .dd-voice-track {
  background: rgba(255, 255, 255, 0.14);
}

.dd-voice-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  pointer-events: none;
  transition: width 0.08s linear;
}

.dd-chat-msg-row.user .dd-voice-progress {
  background: rgba(0, 0, 0, 0.78);
}

.dd-chat-msg-row.admin .dd-voice-progress {
  background: #F59E0B;
}

.dd-voice-scrubber {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.dd-voice-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dd-chat-msg-row.user .dd-voice-time-row {
  color: rgba(0, 0, 0, 0.8);
}

.dd-chat-msg-row.admin .dd-voice-time-row {
  color: #94A3B8;
}

.dd-voice-mic-icon {
  font-size: 9px;
  opacity: 0.7;
}

/* Image & File Bubbles in DD Chat */
.dd-chat-img-bubble {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 250px;
}

.dd-chat-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.dd-chat-img-wrap img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 9px;
  transition: transform 0.25s ease;
}

.dd-chat-img-wrap:hover img {
  transform: scale(1.03);
}

.dd-chat-img-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

.dd-chat-img-wrap:hover .dd-chat-img-overlay {
  opacity: 1;
}

.dd-chat-img-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.dd-chat-msg-row.user .dd-chat-img-info {
  color: rgba(0, 0, 0, 0.85);
}

.dd-chat-msg-row.admin .dd-chat-img-info {
  color: #94A3B8;
}

.dd-chat-img-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.dd-chat-img-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dd-chat-img-action-btn {
  color: inherit;
  opacity: 0.8;
  text-decoration: none;
  font-size: 11px;
  transition: opacity 0.15s;
}

.dd-chat-img-action-btn:hover {
  opacity: 1;
}

/* File Attachment Bubble */
.dd-chat-file-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 290px;
  padding: 4px 2px;
}

.dd-chat-file-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.dd-chat-msg-row.user .dd-chat-file-icon-box {
  background: rgba(0, 0, 0, 0.15);
  color: #000000;
}

.dd-chat-msg-row.admin .dd-chat-file-icon-box {
  background: rgba(255, 255, 255, 0.08);
  color: #F59E0B;
}

.dd-chat-file-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dd-chat-file-title {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.dd-chat-msg-row.user .dd-chat-file-title {
  color: #000000;
}

.dd-chat-msg-row.admin .dd-chat-file-title {
  color: #FFFFFF;
}

.dd-chat-file-meta {
  font-size: 10px;
  font-weight: 600;
}

.dd-chat-msg-row.user .dd-chat-file-meta {
  color: rgba(0, 0, 0, 0.75);
}

.dd-chat-msg-row.admin .dd-chat-file-meta {
  color: #94A3B8;
}

.dd-chat-file-dl-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  font-size: 12px;
  transition: all 0.2s;
}

.dd-chat-msg-row.user .dd-chat-file-dl-btn {
  background: rgba(0, 0, 0, 0.2);
  color: #000000;
}

.dd-chat-msg-row.user .dd-chat-file-dl-btn:hover {
  background: #000000;
  color: #FFFFFF;
  transform: scale(1.1);
}

.dd-chat-msg-row.admin .dd-chat-file-dl-btn {
  background: #F59E0B;
  color: #000000;
}

.dd-chat-msg-row.admin .dd-chat-file-dl-btn:hover {
  background: #D97706;
  color: #FFFFFF;
  transform: scale(1.1);
}

/* Lightbox Modal for Image Preview */
.dd-chat-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: none;
  flex-direction: column;
  animation: ddLbFade 0.2s ease;
}

@keyframes ddLbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dd-chat-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dd-chat-lightbox-title {
  color: #F8FAFC;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.dd-chat-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dd-chat-lightbox-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.dd-chat-lightbox-btn:hover {
  background: #F59E0B;
  color: #000;
  border-color: #F59E0B;
}

.dd-chat-lightbox-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.dd-chat-lightbox-close:hover {
  color: #EF4444;
}

.dd-chat-lightbox-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 0;
  cursor: zoom-out;
}

.dd-chat-lightbox-img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  cursor: default;
}

/* Mobile responsive — fixed popup chat widget (NOT full screen) */
@media (max-width: 768px) {
  .dd-chat-widget-window {
    position: fixed !important;
    bottom: 90px !important;
    right: 12px !important;
    left: 12px !important;
    top: auto !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    height: 72vh !important;
    max-height: 520px !important;
    min-height: 320px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 25px rgba(245, 158, 11, 0.15) !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 2147483647 !important;
    transform: translateY(20px) scale(0.96) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  }

  .dd-chat-widget-window.open {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
    pointer-events: all !important;
  }

  .dd-chat-header {
    flex-shrink: 0 !important;
    padding: 12px 14px !important;
  }

  .dd-chat-body {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px !important;
  }

  .dd-chat-footer {
    flex-shrink: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 10 !important;
    padding: 10px 12px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    background: #1E293B !important;
  }

  .dd-chat-input {
    min-width: 0 !important;
    font-size: 16px !important;
    padding: 9px 14px !important;
    min-height: 38px !important;
  }

  .dd-chat-send-btn {
    flex-shrink: 0 !important;
    width: 38px !important;
    height: 38px !important;
  }
}

