@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ── WELCOME BADGE ────────────────────────────── */
.mediafy-welcome-badge {
  position: fixed;
  bottom: 104px;
  right: 28px;
  padding: 10px 16px 10px 12px;
  background: #0a0a12;
  border: 1px solid rgba(37,99,235,0.35);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(37,99,235,0.1), 0 0 40px rgba(37,99,235,0.08);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  display: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  z-index: 999999;
  cursor: pointer;
  animation: badgeIn 0.4s cubic-bezier(.22,.68,0,1.2) both;
  backdrop-filter: blur(12px);
}

.mediafy-welcome-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  animation: pulseDot 2s ease infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(59,130,246,0); }
}

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

/* ── TOGGLER ──────────────────────────────────── */
.chatbot-toggler {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #2563eb;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  height: 56px;
  width: 56px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.45), 0 0 0 1px rgba(37,99,235,0.3);
  cursor: pointer;
  z-index: 999999;
  color: #fff;
  opacity: 0;
  transform: scale(0.5) translateY(8px);
  transition: opacity 0.4s cubic-bezier(.22,.68,0,1.2), transform 0.4s cubic-bezier(.22,.68,0,1.2), box-shadow 0.2s;
}

.chatbot-toggler:hover {
  box-shadow: 0 12px 32px rgba(37,99,235,0.6), 0 0 0 1px rgba(37,99,235,0.4);
  transform: scale(1.05) !important;
}

.chatbot-toggler.show {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.chatbot-toggler span { transition: all 0.25s ease; }
.chatbot-toggler span:last-child { display: none; }

.show-mediafy-widget .chatbot-toggler span:first-child { display: none; }
.show-mediafy-widget .chatbot-toggler span:last-child {
  display: block;
  animation: rotateIn 0.25s ease-out;
}

@keyframes rotateIn {
  from { transform: rotate(-90deg); opacity: 0; }
  to { transform: rotate(0); opacity: 1; }
}

/* ── WIDGET ───────────────────────────────────── */
.chatbot-widget {
  position: fixed;
  right: 28px;
  bottom: 96px;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #05050d;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.7),
    0 0 0 1px rgba(37,99,235,0.08),
    0 0 80px rgba(37,99,235,0.05);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.94) translateY(8px);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(.22,.68,0,1.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999998;
}

.show-mediafy-widget .chatbot-widget {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* ── HEADER ───────────────────────────────────── */
.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #05050d;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 10px; }

.header-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  flex-shrink: 0;
}

.header-info { display: flex; flex-direction: column; gap: 1px; }

.header-name {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-family: 'Inter', sans-serif;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10a37f;
  animation: pulseDot 2s ease infinite;
}

.header-ai-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3b82f6;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.2);
  padding: 3px 8px;
  border-radius: 100px;
}

.header-actions { display: flex; gap: 4px; }

.header-icon-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-size: 18px;
}

.header-icon-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}

/* ── SETTINGS PANEL ───────────────────────────── */
.settings-panel {
  position: absolute;
  top: 65px;
  left: 0;
  width: 100%;
  height: calc(100% - 65px);
  background: #05050d;
  z-index: 15;
  padding: 20px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.settings-panel.active { display: flex; }

.settings-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.contact-icon {
  width: 36px;
  height: 36px;
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
  flex-shrink: 0;
  font-size: 18px;
}

.contact-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  font-family: 'Inter', sans-serif;
  margin-bottom: 3px;
}

.contact-value {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}

.contact-value a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.15s;
}
.contact-value a:hover { color: #3b82f6; }

/* ── CONTENT AREA ─────────────────────────────── */
.widget-content {
  flex: 1;
  padding: 0 20px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #05050d;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(37,99,235,0.3) transparent;
}

.widget-content::-webkit-scrollbar { width: 3px; }
.widget-content::-webkit-scrollbar-track { background: transparent; }
.widget-content::-webkit-scrollbar-thumb { background: rgba(37,99,235,0.3); border-radius: 10px; }

/* ── INITIAL CONTENT ──────────────────────────── */
.initial-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 0 16px;
}

.welcome-text h2 {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  line-height: 1.2;
}

.welcome-text p {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  font-family: 'Inter', sans-serif;
  margin: 0;
  line-height: 1.6;
}

/* ── CHIPS ────────────────────────────────────── */
.chips-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  font-family: 'Inter', sans-serif;
  margin-bottom: 8px;
}

.action-chips {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 11px 14px;
  border-radius: 100px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.chip::before {
  content: '→';
  font-size: 12px;
  color: rgba(37,99,235,0.6);
  transition: transform 0.18s, color 0.18s;
  flex-shrink: 0;
}

.chip:hover {
  border-color: rgba(37,99,235,0.4);
  background: rgba(37,99,235,0.06);
  color: #fff;
  transform: translateX(2px);
}

.chip:hover::before {
  transform: translateX(2px);
  color: #3b82f6;
}

/* ── CHATBOX ──────────────────────────────────── */
.chatbox {
  list-style: none;
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 20px 0 12px;
  margin: 0;
}

.chatbox.active { display: flex; }

.chat-message {
  display: flex;
  align-items: flex-end;
  width: 100%;
  gap: 8px;
}

.chat-message.outgoing { justify-content: flex-end; }

.bot-icon {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 10px;
  color: #fff;
  flex-shrink: 0;
}

.message-text {
  display: block !important;
  width: fit-content;
  max-width: 270px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: pre-wrap;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
  border-radius: 4px 14px 14px 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.chat-message.outgoing .message-text {
  background: #2563eb;
  border-color: transparent;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}

/* Loading dots */
.loading-message {
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.loading-dot {
  width: 5px;
  height: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  animation: loadingPulse 1.2s ease infinite;
}

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

@keyframes loadingPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── INPUT AREA ───────────────────────────────── */
.bottom-input-area {
  padding: 12px 16px 14px;
  background: #05050d;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.input-container-dark {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px 8px;
  transition: border-color 0.2s;
}

.input-container-dark:focus-within {
  border-color: rgba(37,99,235,0.4);
  background: rgba(37,99,235,0.03);
}

.chat-input-field {
  background: transparent;
  border: none;
  color: #fff;
  width: 100%;
  outline: none;
  resize: none;
  min-height: 20px;
  max-height: 100px;
  padding: 0;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

.chat-input-field::placeholder { color: rgba(255,255,255,0.2); }

.input-controls-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
  gap: 6px;
}

.voice-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s;
}

.voice-btn:hover {
  border-color: rgba(37,99,235,0.4);
  color: #3b82f6;
}

.voice-btn.listening {
  border-color: rgba(37,99,235,0.5);
  color: #3b82f6;
  background: rgba(37,99,235,0.08);
}

.send-btn {
  background: #2563eb;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  transition: opacity 0.15s, transform 0.15s;
  font-size: 16px;
  flex-shrink: 0;
}

.send-btn:hover { opacity: 0.85; transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }

.mediafy-footer {
  text-align: center;
  padding: 8px 0 0;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.15);
  letter-spacing: 0.04em;
}

/* ── MOBILE ───────────────────────────────────── */
@media (max-width: 450px) {
  .chatbot-widget {
    width: 100%;
    height: 100%;
    right: 0;
    bottom: 0;
    border-radius: 0;
  }

  .show-mediafy-widget .chatbot-widget {
    height: 100dvh;
  }

  .mediafy-welcome-badge { display: none !important; }

  .chatbot-toggler {
    bottom: 20px;
    right: 20px;
  }
}

/* ── HIDE BADGE WHEN WIDGET OPEN ─────────────── */
body.show-mediafy-widget .mediafy-welcome-badge {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── TYPEWRITER CURSOR ────────────────────────── */
.streaming-cursor::after {
  content: '▋';
  color: #3b82f6;
  animation: bcur .7s step-end infinite;
}
@keyframes bcur {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
