/* HeyGen Avatar Embed Styles - FLC Brand Colors */
/* Main gradient: #021225 → #023A75 */
/* Highlight 1: #23A3DB */
/* Highlight 2: #446DA9 */
/* Accent: #FFFFFF */

.heygen-avatar-wrapper {
  --flc-dark: #021225;
  --flc-primary: #023A75;
  --flc-highlight-1: #23A3DB;
  --flc-highlight-2: #446DA9;
  --flc-accent: #FFFFFF;
  --flc-gradient: linear-gradient(135deg, #021225 0%, #023A75 100%);
  box-sizing: border-box;
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 92px;
  height: 72px;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--flc-gradient);
  overflow: visible;
  --embed-height: min(86vh, 760px);
  border-radius: 22px;
  box-shadow: 0 12px 36px rgba(2, 18, 37, 0.45), 0 4px 14px rgba(35, 163, 219, 0.35);
  transition: width 0.34s ease, height 0.34s ease, border-radius 0.34s ease, box-shadow 0.28s ease;
  z-index: 2147483000;
  isolation: isolate;
}

.heygen-avatar-wrapper *,
.heygen-avatar-wrapper *::before,
.heygen-avatar-wrapper *::after {
  box-sizing: border-box;
}

.heygen-avatar-wrapper button,
.heygen-avatar-wrapper input {
  font: inherit;
}

.heygen-avatar-wrapper.session-open {
  --chat-width: 380px;
  width: min(95vw, 1080px);
  height: min(86vh, 760px);
  right: 24px;
  bottom: 24px;
  border-radius: 18px;
  background: var(--flc-dark);
  box-shadow: 0 20px 48px rgba(2, 18, 37, 0.6);
  overflow: hidden;
  opacity: 1;
}

.flc-widget-launcher {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  border: none;
  background: var(--flc-gradient);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flc-widget-launcher:hover {
  transform: translateY(-2px) scale(1.02);
}

.flc-widget-launcher:focus-visible {
  outline: 3px solid var(--flc-highlight-1);
  outline-offset: 3px;
}

.flc-widget-launcher::after {
  content: none;
}

.flc-widget-launcher::before {
  content: none;
}

.flc-widget-logo {
  width: 54px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 auto;
}

.flc-widget-name {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.flc-widget-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 10px 13px;
  border-radius: 8px;
  background: #021225;
  color: #fff;
  box-shadow: 0 8px 24px rgba(2, 18, 37, 0.28);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.flc-widget-tooltip::after {
  position: absolute;
  top: 100%;
  right: 30px;
  width: 0;
  height: 0;
  border: 7px solid transparent;
  border-top-color: #021225;
  content: '';
}

.flc-widget-tooltip.opens-right {
  right: auto;
  left: 0;
}

.flc-widget-tooltip.opens-right::after {
  right: auto;
  left: 30px;
}

.flc-widget-launcher:hover .flc-widget-tooltip,
.flc-widget-launcher:focus-visible .flc-widget-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Launcher visual variants (1-6) */
.flc-widget-launcher.variant-1 {
  background: var(--flc-gradient);
}

.flc-widget-launcher.variant-2 {
  background: linear-gradient(135deg, #f8fbff 0%, #dbeeff 100%);
  border: 1px solid rgba(0, 48, 93, 0.15);
}

.flc-widget-launcher.variant-3 {
  background: linear-gradient(135deg, #011126 0%, #012a5b 100%);
  box-shadow: inset 0 0 0 1px rgba(35, 163, 219, 0.25);
}

.flc-widget-launcher.variant-4 {
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  border: 1px solid rgba(0, 48, 93, 0.12);
}

.flc-widget-launcher.variant-5 {
  background: linear-gradient(135deg, #032044 0%, #0a4e8f 100%);
}

.flc-widget-launcher.variant-6 {
  background: linear-gradient(135deg, #f3f8ff 0%, #d7e8ff 100%);
  border: 1px solid rgba(0, 48, 93, 0.18);
}

.flc-widget-launcher.variant-2 .flc-widget-name,
.flc-widget-launcher.variant-4 .flc-widget-name,
.flc-widget-launcher.variant-6 .flc-widget-name {
  color: #012a5b;
}

.heygen-avatar-wrapper.session-open .flc-widget-launcher {
  display: none;
}

.window-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(2, 18, 37, 0.85);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  border: 1px solid rgba(35, 163, 219, 0.25);
}

/* Maintain a consistent window height across session states */
.initial-state,
.connecting-state,
.video-container {
  height: var(--embed-height);
}

.heygen-avatar-wrapper:not(.session-open) .initial-state,
.heygen-avatar-wrapper:not(.session-open) .connecting-state,
.heygen-avatar-wrapper:not(.session-open) .avatar-interface,
.heygen-avatar-wrapper:not(.session-open) .chat-panel,
.heygen-avatar-wrapper:not(.session-open) .status-indicator {
  display: none !important;
}

/* Initial State */
.initial-state {
  position: relative;
  width: 100%;
  height: var(--embed-height);
  background: var(--flc-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--flc-accent);
}

.initial-state-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.08)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.4;
}

.initial-state-content {
  z-index: 2;
  text-align: center;
  padding: 40px;
}

.avatar-icon {
  width: 80px;
  height: 80px;
  background: rgba(35, 163, 219, 0.2);
  border: 2px solid rgba(35, 163, 219, 0.4);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: 0 4px 24px rgba(35, 163, 219, 0.3);
}

.initial-state h2 {
  margin: 0 0 20px;
  font-size: 42px;
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.initial-state p {
  margin: 0 0 32px;
  font-size: 18px;
  opacity: 0.9;
  max-width: 550px;
  text-align: center;
  line-height: 1.6;
}

.initial-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.start-chat-btn {
  padding: 14px 36px;
  border: none;
  border-radius: 8px;
  background: var(--flc-highlight-1);
  color: var(--flc-accent);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 24px rgba(35, 163, 219, 0.4);
  margin-top: 8px;
}

.start-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(35, 163, 219, 0.5);
  background: #1a8fc4;
}

/* Connecting State */
.connecting-state {
  position: relative;
  width: 100%;
  height: var(--embed-height);
  background: var(--flc-gradient);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--flc-accent);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(35, 163, 219, 0.3);
  border-top: 3px solid var(--flc-highlight-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

.connecting-state h3 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
}

.connecting-state p {
  margin: 0;
  font-size: 16px;
  opacity: 0.7;
  text-align: center;
  max-width: 400px;
}

/* Avatar Interface */
.avatar-interface {
  position: relative;
  width: 100%;
  display: none;
}

.time-counter {
  position: absolute;
  top: 66px;
  left: 16px;
  z-index: 10;
  background: rgba(2, 18, 37, 0.9);
  color: var(--flc-accent);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(35, 163, 219, 0.2);
}

.stream-brand-badge {
  position: absolute;
  top: calc(var(--stream-offset-y, 0px) + 12px);
  left: calc(var(--stream-offset-x, 0px) + 16px);
  z-index: 12;
  height: 38px;
  min-width: 74px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(2, 18, 37, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.stream-brand-logo {
  width: 52px;
  height: 22px;
  object-fit: contain;
}

.video-container.stream-overlay-ready .stream-brand-badge {
  opacity: 1;
}

.current-avatar-indicator {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(2, 18, 37, 0.9);
  color: var(--flc-accent);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-container {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.menu-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: rgba(2, 18, 37, 0.9);
  color: var(--flc-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(35, 163, 219, 0.2);
  transition: all 0.2s ease;
}

.menu-btn:hover {
  background: rgba(35, 163, 219, 0.2);
  border-color: var(--flc-highlight-1);
}

.video-container {
  position: relative;
  width: 100%;
  background: var(--flc-gradient);
}

.heygen-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: transparent;
}

.audio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 18, 37, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.audio-overlay.media-unlock {
  top: auto;
  padding: 26px 16px 16px;
  background: linear-gradient(to top, rgba(2, 18, 37, 0.9), transparent);
  backdrop-filter: none;
}

.audio-overlay.media-unlock .enable-audio-btn {
  padding: 10px 18px;
  box-shadow: 0 6px 20px rgba(2, 18, 37, 0.35);
  font-size: 14px;
}

.enable-audio-btn {
  padding: 16px 32px;
  border: none;
  border-radius: 12px;
  background: var(--flc-highlight-1);
  color: var(--flc-accent);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 24px rgba(35, 163, 219, 0.4);
}

.enable-audio-btn:hover {
  background: #1a8fc4;
  transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(35, 163, 219, 0.5);
}

.control-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(2, 18, 37, 0.95);
  padding: 12px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(35, 163, 219, 0.2);
}

.control-btn {
  min-width: 44px;
  height: 44px;
  border: none;
  border-radius: 22px;
  color: var(--flc-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 0 16px;
  white-space: nowrap;
}

.call-btn {
  background: #dc2626;
  color: var(--flc-accent);
  font-weight: 600;
}

.call-btn:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.mic-btn {
  background: var(--flc-highlight-1);
  color: var(--flc-accent);
  font-weight: 600;
}

.mic-btn:hover {
  background: #1a8fc4;
  transform: translateY(-1px);
}

.mic-btn.listening {
  background: var(--flc-highlight-2);
  animation: pulse 2s infinite;
}

.mic-btn.listening:hover {
  background: #3a5d94;
}

.mic-btn.disabled {
  background: rgba(255, 255, 255, 0.15);
  opacity: 0.8;
}

.mic-btn.disabled:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(35, 163, 219, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(35, 163, 219, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(35, 163, 219, 0);
  }
}

/* Chat Panel */
.chat-panel {
  position: absolute;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: var(--flc-dark);
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.5);
  transition: right 0.32s ease;
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow: hidden;
}

.chat-panel.open {
  right: 0;
}

.chat-input:disabled,
.send-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Widget-open layout: keep chat visible and avatar shifted left */
.heygen-avatar-wrapper.session-open .chat-panel {
  right: 0;
  width: var(--chat-width);
}

.heygen-avatar-wrapper.session-open .avatar-interface {
  width: calc(100% - var(--chat-width));
  padding-right: 0;
}

.heygen-avatar-wrapper.session-open .video-container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.heygen-avatar-wrapper.session-open .video-container .heygen-video {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.heygen-avatar-wrapper.session-open .initial-state,
.heygen-avatar-wrapper.session-open .connecting-state {
  width: calc(100% - var(--chat-width));
  padding-right: 0;
  box-sizing: border-box;
}

.heygen-avatar-wrapper.session-open .menu-container,
.heygen-avatar-wrapper.session-open .close-chat-btn {
  display: none;
}

.heygen-avatar-wrapper.session-open .heygen-video {
  object-position: center center;
}

.heygen-avatar-wrapper.session-open .control-bar {
  left: 50% !important;
  right: auto !important;
  margin: 0 !important;
  width: max-content;
  transform: translateX(-50%) !important;
}

.heygen-avatar-wrapper.session-open .chat-header-buttons {
  margin-right: 44px;
}

.chat-header {
  padding: 20px;
  border-bottom: 1px solid rgba(35, 163, 219, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 58, 117, 0.3);
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--flc-accent);
}

.chat-header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-chat-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--flc-highlight-1);
  color: var(--flc-accent);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.export-chat-btn:hover {
  background: #1a8fc4;
  transform: translateY(-1px);
}

.close-chat-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.close-chat-btn:hover {
  color: var(--flc-accent);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(2, 18, 37, 0.5);
}

.chat-welcome {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  margin-bottom: 20px;
}

.chat-message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 80%;
  word-wrap: break-word;
  position: relative;
}

.chat-message.user {
  background: var(--flc-highlight-1);
  color: var(--flc-accent);
  margin-left: auto;
  text-align: right;
}

.chat-message.avatar {
  background: rgba(68, 109, 169, 0.3);
  color: var(--flc-accent);
  margin-right: auto;
  border: 1px solid rgba(68, 109, 169, 0.4);
}

.chat-message.avatar.placeholder {
  background: rgba(68, 109, 169, 0.2);
  font-style: italic;
  opacity: 0.8;
  border-left: 3px solid var(--flc-highlight-1);
}

.chat-message.speech-message {
  border-left: 3px solid var(--flc-highlight-1);
}

.speech-icon, .avatar-icon-chat {
  font-size: 14px;
  margin-right: 6px;
}

.message-time {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 4px;
  font-style: italic;
}

.chat-message.user .message-time {
  text-align: right;
}

.chat-message.avatar .message-time {
  text-align: left;
}

/* Bot typing indicator */
.bot-typing-indicator {
  background: rgba(68, 109, 169, 0.2) !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

.typing-dots {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--flc-highlight-1);
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: scale(1); opacity: 0.5; }
  30% { transform: scale(1.2); opacity: 1; }
}

.chat-input-container {
  padding: 20px;
  border-top: 1px solid rgba(35, 163, 219, 0.2);
  background: rgba(2, 58, 117, 0.3);
}

.chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(2, 18, 37, 0.8);
  border-radius: 24px;
  padding: 8px 16px;
  border: 1px solid rgba(35, 163, 219, 0.2);
}

.chat-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  padding: 8px 0;
  color: var(--flc-accent);
}

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

.send-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--flc-highlight-1);
  color: var(--flc-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.send-btn:hover {
  background: #1a8fc4;
  transform: scale(1.05);
}

/* Status Indicator */
.status-indicator {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(2, 18, 37, 0.95);
  color: var(--flc-accent);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  display: none;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(35, 163, 219, 0.2);
}

.status-indicator.error {
  background: rgba(220, 38, 38, 0.95);
  border-color: rgba(220, 38, 38, 0.5);
}

/* Avatar Selection Info */
.avatar-selection-info {
  margin: 20px 0;
  padding: 16px;
  background: rgba(35, 163, 219, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(35, 163, 219, 0.2);
}

.avatar-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.avatar-emoji {
  font-size: 20px;
}

.avatar-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--flc-accent);
}

/* Selected Avatar Display */
.selected-avatar-display {
  margin: 20px 0;
  padding: 16px;
  background: rgba(35, 163, 219, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.avatar-card {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.avatar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.avatar-label {
  font-size: 12px;
  opacity: 0.7;
  color: var(--flc-accent);
}

.avatar-id {
  font-size: 14px;
  font-weight: 500;
  color: var(--flc-accent);
}

/* Searching Indicator Styles */
.searching-indicator {
  background: transparent !important;
  padding: 8px 0 !important;
  max-width: 100% !important;
}

.searching-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(2, 58, 117, 0.4);
  border: 1px solid rgba(35, 163, 219, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.searching-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(35, 163, 219, 0.3);
  border-top: 2px solid var(--flc-highlight-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.searching-content {
  display: flex;
  align-items: center;
  gap: 2px;
}

.searching-text {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.searching-dots {
  display: inline-flex;
}

.searching-dots span {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  animation: blink 1.4s infinite;
}

.searching-dots span:nth-child(1) { animation-delay: 0s; }
.searching-dots span:nth-child(2) { animation-delay: 0.2s; }
.searching-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

/* Course Link Card Styles */
.course-link-message {
  background: transparent !important;
  padding: 8px 0 !important;
  max-width: 100% !important;
}

.course-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(2, 58, 117, 0.5);
  border: 1px solid rgba(35, 163, 219, 0.3);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.course-link-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.course-link-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.course-link-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--flc-highlight-1);
}

.course-link-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--flc-highlight-1);
  color: var(--flc-accent);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(35, 163, 219, 0.3);
}

.course-link-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(35, 163, 219, 0.4);
  background: #1a8fc4;
}

.course-link-button .link-arrow {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.course-link-button:hover .link-arrow {
  transform: translateX(3px);
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hover Effects */
.heygen-avatar-wrapper button:hover {
  transform: translateY(-1px);
}

.heygen-avatar-wrapper button:active {
  transform: translateY(0);
}

/* Scrollbar Styles */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(2, 18, 37, 0.5);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--flc-highlight-2);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--flc-highlight-1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .heygen-avatar-wrapper {
    right: 16px;
    bottom: 16px;
    width: 82px;
    height: 64px;
    border-radius: 18px;
  }

  .heygen-avatar-wrapper.session-open {
    --chat-width: 100%;
    width: calc(100vw - 16px);
    height: min(92dvh, 760px);
    max-height: calc(100dvh - 16px);
    right: 8px;
    bottom: 8px;
    border-radius: 14px;
  }

  .flc-widget-launcher {
    border-radius: 18px;
  }

  .flc-widget-logo {
    width: 48px;
    height: 27px;
  }

  .flc-widget-name {
    font-size: 11px;
  }

  .chat-panel {
    width: 100%;
    right: -100%;
  }
  
  .chat-panel.open {
    right: 0;
  }

  .heygen-avatar-wrapper.session-open .avatar-interface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 42%;
    padding-right: 0;
    overflow: hidden;
  }

  .heygen-avatar-wrapper.session-open .initial-state,
  .heygen-avatar-wrapper.session-open .connecting-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 42%;
    padding-right: 0;
  }

  .heygen-avatar-wrapper.session-open .chat-panel {
    top: 42%;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58%;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
  }

  .heygen-avatar-wrapper.session-open .video-container {
    height: 100% !important;
    overflow: hidden;
  }

  .heygen-avatar-wrapper.session-open .video-container .heygen-video {
    height: 100% !important;
    object-fit: cover;
  }

  .heygen-avatar-wrapper.session-open .control-bar {
    bottom: 8px;
    left: 50%;
    z-index: 30;
    max-width: calc(100% - 24px);
    padding: 6px;
    gap: 6px;
    flex-direction: row;
    transform: translateX(-50%);
  }

  .heygen-avatar-wrapper.session-open .time-counter {
    top: 10px;
    left: 10px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .heygen-avatar-wrapper.session-open .window-close-btn {
    top: 8px;
    right: 8px;
  }

  .heygen-avatar-wrapper.session-open .chat-header {
    min-height: 48px;
    padding: 10px 14px;
  }

  .heygen-avatar-wrapper.session-open .chat-header-buttons {
    margin-right: 0;
  }

  .heygen-avatar-wrapper.session-open .chat-messages {
    min-height: 0;
    padding: 12px;
  }

  .heygen-avatar-wrapper.session-open .chat-message {
    max-width: 90%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .heygen-avatar-wrapper.session-open .chat-input-container {
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }

  .heygen-avatar-wrapper.session-open .chat-input-wrapper {
    padding: 6px 10px;
  }

  .heygen-avatar-wrapper.session-open .status-indicator {
    top: 10px;
    right: 52px;
    bottom: auto;
    left: auto;
    max-width: calc(100% - 190px);
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .initial-controls {
    flex-direction: column;
  }
  
  .control-bar {
    flex-direction: row;
    gap: 6px;
    padding: 6px;
  }
  
  .control-btn {
    min-width: 0;
    height: 36px;
    font-size: 13px;
    padding: 0 12px;
  }
  
  .current-avatar-indicator {
    top: 60px;
    font-size: 12px;
    padding: 6px 10px;
  }
}
