/* Dr. Talha Clinic AI Chatbot Widget Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --dt-primary: #1568D6;
  --dt-primary-dark: #0F4FAE;
  --dt-navy: #0F1A2E;
  --dt-bg: #FFFFFF;
  --dt-bg-soft: #F5F8FC;
  --dt-tint: #EAF2FD;
  --dt-border: #E3E9F2;
  --dt-text: #1B2740;
  --dt-text-soft: #5B6981;
  --dt-text-dim: #8996AC;
  --dt-green: #1A9E6B;
  --dt-radius-lg: 16px;
  --dt-radius-md: 12px;
  --dt-radius-sm: 8px;
  --dt-shadow: 0 12px 36px rgba(15, 79, 174, 0.18), 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Floating Launcher Wrapper */
.dt-launcher-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pulsing Radar Wave */
.dt-launcher-ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(21, 104, 214, 0.35);
  z-index: -1;
  pointer-events: none;
  animation: dt-ripple-wave 2.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes dt-ripple-wave {
  0% {
    transform: scale(0.95);
    opacity: 0.85;
  }
  65% {
    transform: scale(1.65);
    opacity: 0;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

.dt-launcher-wrap:has(.dt-active) .dt-launcher-ripple {
  display: none;
}

/* Floating Launcher Button */
.dt-widget-launcher {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dt-primary) 0%, var(--dt-primary-dark) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--dt-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  outline: none;
}

/* Proactive Teaser Bubble */
.dt-teaser-popup {
  position: fixed;
  bottom: 98px;
  right: 24px;
  z-index: 99998;
  max-width: 320px;
  width: calc(100vw - 48px);
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 79, 174, 0.22), 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1.5px solid rgba(21, 104, 214, 0.18);
  padding: 14px 16px 12px;
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  direction: ltr;
  user-select: none;
}

.dt-teaser-popup.dt-teaser-visible {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: dt-teaser-float 3.5s ease-in-out infinite alternate;
}

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

/* Teaser Close Button */
.dt-teaser-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: #F1F5F9;
  border: none;
  border-radius: 50%;
  color: #64748B;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
  padding: 0;
}

.dt-teaser-close:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.dt-teaser-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dt-teaser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 22px;
}

.dt-teaser-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dt-primary);
  font-family: 'Outfit', sans-serif;
}

.dt-teaser-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: dt-pulse 2s infinite;
  flex-shrink: 0;
}

.dt-teaser-lang {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748B;
  background: #F1F5F9;
  padding: 2px 7px;
  border-radius: 10px;
}

.dt-teaser-body {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.dt-teaser-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--dt-navy);
  font-weight: 500;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Arabic', sans-serif;
}

.dt-teaser-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px dashed #E2E8F0;
  margin-top: 2px;
}

.dt-teaser-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dt-primary);
  letter-spacing: 0.2px;
}

.dt-teaser-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dt-tdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: all 0.25s ease;
}

.dt-tdot.active {
  width: 16px;
  border-radius: 4px;
  background: var(--dt-primary);
}

/* Speech Bubble Arrow pointing down to launcher */
.dt-teaser-arrow {
  position: absolute;
  bottom: -8px;
  right: 28px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-right: 1.5px solid rgba(21, 104, 214, 0.18);
  border-bottom: 1.5px solid rgba(21, 104, 214, 0.18);
  transform: rotate(45deg);
  border-bottom-right-radius: 3px;
}

.dt-widget-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 16px 40px rgba(15, 79, 174, 0.3);
}

.dt-widget-launcher:active {
  transform: scale(0.96);
}

.dt-widget-launcher svg {
  width: 28px;
  height: 28px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.dt-widget-launcher .dt-icon-close {
  display: none;
}

.dt-widget-launcher.dt-active .dt-icon-chat {
  display: none;
}

.dt-widget-launcher.dt-active .dt-icon-close {
  display: block;
}

/* Unread Badge */
.dt-widget-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #D64545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: dt-pulse 2s infinite;
}

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

/* Chat Window */
.dt-widget-box {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 99998;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--dt-bg);
  border-radius: var(--dt-radius-lg);
  box-shadow: var(--dt-shadow);
  border: 1px solid var(--dt-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: var(--dt-text);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dt-widget-box.dt-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.dt-widget-header {
  background: linear-gradient(135deg, var(--dt-navy) 0%, var(--dt-primary-dark) 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dt-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dt-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.dt-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 2px solid #fff;
}

.dt-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: var(--dt-green);
  border: 2px solid var(--dt-navy);
  border-radius: 50%;
}

.dt-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin: 0;
}

.dt-header-sub {
  font-size: 12px;
  color: #CFE0F7;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

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

.dt-header-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 8px;
  color: #fff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.dt-header-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.dt-header-btn svg {
  width: 16px;
  height: 16px;
}

/* Messages Area */
.dt-widget-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: var(--dt-bg-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Message Bubble */
.dt-message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.dt-message-row.dt-user {
  justify-content: flex-end;
}

.dt-message-bubble {
  max-width: 82%;
  padding: 11px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: 14px;
  word-break: break-word;
}

.dt-message-row.dt-bot .dt-message-bubble {
  background: #FFFFFF;
  color: var(--dt-text);
  border: 1px solid var(--dt-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.dt-message-row.dt-user .dt-message-bubble {
  background: var(--dt-primary);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(21, 104, 214, 0.25);
}

.dt-message-time {
  font-size: 10px;
  color: var(--dt-text-dim);
  margin-top: 6px;
  display: block;
}

.dt-message-row.dt-user .dt-message-time {
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
}

.dt-message-bubble strong {
  font-weight: 700;
}

.dt-message-row.dt-bot .dt-message-bubble strong {
  color: var(--dt-navy);
}

.dt-message-bubble .dt-heading {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--dt-primary-dark);
  margin: 4px 0 6px;
}

.dt-message-bubble .dt-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0;
  line-height: 1.45;
}

.dt-message-bubble .dt-bullet-dot {
  color: var(--dt-primary);
  font-weight: 800;
  flex-shrink: 0;
}

/* Suggestion Chips */
.dt-widget-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.dt-chip-btn {
  background: #FFFFFF;
  border: 1px solid var(--dt-border);
  color: var(--dt-primary);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dt-chip-btn:hover {
  background: var(--dt-tint);
  border-color: var(--dt-primary);
  transform: translateY(-1px);
}

/* Typing Indicator */
.dt-typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  background: #fff;
  padding: 10px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--dt-border);
  width: fit-content;
}

.dt-typing-indicator.dt-active {
  display: flex;
}

.dt-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--dt-primary);
  border-radius: 50%;
  animation: dt-bounce 1.4s infinite ease-in-out both;
}

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

@keyframes dt-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.dt-widget-input-area {
  padding: 12px 14px;
  background: #FFFFFF;
  border-top: 1px solid var(--dt-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dt-widget-input {
  flex: 1;
  border: 1px solid var(--dt-border);
  background: var(--dt-bg-soft);
  border-radius: var(--dt-radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--dt-text);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.dt-widget-input:focus {
  border-color: var(--dt-primary);
  background: #FFFFFF;
}

.dt-widget-send-btn {
  background: var(--dt-primary);
  border: none;
  border-radius: var(--dt-radius-sm);
  width: 38px;
  height: 38px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}

.dt-widget-send-btn:hover {
  background: var(--dt-primary-dark);
}

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

.dt-widget-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Footer Tagline */
.dt-widget-footer-text {
  text-align: center;
  font-size: 11px;
  color: var(--dt-text-dim);
  background: #FFFFFF;
  padding: 4px 10px 8px;
}

.dt-widget-footer-text a {
  color: var(--dt-primary);
  text-decoration: none;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .dt-widget-box {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
    height: calc(100vh - 110px);
    max-height: 520px;
  }
  .dt-launcher-wrap {
    bottom: 18px;
    right: 18px;
    width: 54px;
    height: 54px;
  }
  .dt-widget-launcher {
    width: 54px;
    height: 54px;
  }
  .dt-teaser-popup {
    right: 14px;
    bottom: 82px;
    max-width: 290px;
    padding: 12px 14px 10px;
  }
  .dt-teaser-arrow {
    right: 22px;
  }
}
