/* ==========================================================================
   SACHIN TONTE AI ASSISTANT — 2030 NEURAL CHATBOT (DARK & LIGHT THEME READY)
   ========================================================================== */

/* Floating Launcher Wrapper (Bottom Right) */
.sachin-ai-launcher-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9995;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Floating Greeting Tooltip Pill */
.sachin-ai-greeting-pill {
  background: rgba(12, 14, 34, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #F8FAFC;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 211, 238, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: aiPillFloat 4s ease-in-out infinite;
  max-width: 290px;
}

.sachin-ai-greeting-pill:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--color-pink);
  box-shadow: 0 12px 32px rgba(255, 79, 216, 0.3);
}

.sachin-ai-greeting-pill .pill-wave {
  font-size: 1rem;
  display: inline-block;
  animation: waveHand 2.2s infinite;
}

.sachin-ai-greeting-pill .pill-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  margin-left: 2px;
}

@keyframes aiPillFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes waveHand {
  0%, 60%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(16deg); }
  30% { transform: rotate(-10deg); }
  45% { transform: rotate(14deg); }
}

/* Floating Launcher Button with Sachin's Face Icon */
.sachin-ai-orb-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sachin-ai-orb-btn:hover {
  transform: scale(1.08) translateY(-2px);
}

/* Rotating Conic Neon Ring Around Face Icon */
.sachin-ai-orb-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #FF4FD8, #22D3EE, #FFB020, #2DD4BF, #8B5CF6, #FF4FD8);
  animation: orbRingSpin 4s linear infinite;
  box-shadow: 0 0 25px rgba(255, 79, 216, 0.45), 0 0 35px rgba(34, 211, 238, 0.3);
}

@keyframes orbRingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sachin-ai-orb-avatar-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: #0B0D24;
  border: 2px solid #0B0D24;
  z-index: 2;
}

.sachin-ai-orb-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Live Online Pulse Dot on Launcher */
.sachin-ai-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #10B981;
  border: 2.5px solid #0B0D24;
  z-index: 4;
  box-shadow: 0 0 10px #10B981;
}

.sachin-ai-ai-badge {
  position: absolute;
  top: -4px;
  left: -6px;
  z-index: 4;
  background: linear-gradient(135deg, #FF4FD8, #7C5CFF);
  color: #FFFFFF;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   CHATBOT WINDOW CONTAINER
   ========================================================================== */
.sachin-ai-window {
  position: fixed;
  bottom: 102px;
  right: 24px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 610px;
  max-height: calc(100vh - 130px);
  z-index: 9996;
  background: rgba(11, 13, 34, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 40px rgba(124, 92, 255, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sachin-ai-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Top Rainbow Laser Bar */
.sachin-ai-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #FF4FD8, #22D3EE, #FFB020, #2DD4BF, #8B5CF6);
  z-index: 5;
}

/* Chatbot Header */
.sachin-ai-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.14) 0%, rgba(34, 211, 238, 0.12) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sachin-ai-header-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.sachin-ai-header-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #FF4FD8, #22D3EE);
  flex-shrink: 0;
}

.sachin-ai-header-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #0B0D24;
}

.sachin-ai-header-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #0B0D24;
}

.sachin-ai-header-info {
  min-width: 0;
}

.sachin-ai-header-title {
  font-family: var(--font-heading, sans-serif);
  font-size: 0.96rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sachin-ai-header-sub {
  font-size: 0.74rem;
  color: #22D3EE;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.sachin-ai-viewer-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  background: rgba(255, 79, 216, 0.2);
  color: #FF85E4;
  border: 1px solid rgba(255, 79, 216, 0.35);
}

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

.sachin-ai-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sachin-ai-icon-btn:hover,
.sachin-ai-icon-btn.is-active {
  background: rgba(34, 211, 238, 0.18);
  border-color: #22D3EE;
  color: #22D3EE;
}

/* ==========================================================================
   STEP 1: VISITOR ONBOARDING GATE (EMAIL + WHO YOU ARE / VIEWER TYPE)
   ========================================================================== */
.sachin-ai-onboarding {
  flex: 1;
  padding: 20px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sachin-ai-welcome-bubble {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 16px;
  padding: 14px;
}

.sachin-ai-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid #22D3EE;
  flex-shrink: 0;
  background: #0B0D24;
}

.sachin-ai-welcome-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #F1F5F9;
}

.sachin-ai-welcome-text strong {
  color: #22D3EE;
}

.sachin-ai-onboarding-form {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sachin-ai-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  margin-bottom: 6px;
  display: block;
}

/* Viewer Type Selector Grid (HR, Company Representative, etc.) */
.sachin-ai-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sachin-ai-role-option {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #E2E8F0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.sachin-ai-role-option:hover {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.08);
}

.sachin-ai-role-option.selected {
  border-color: #FF4FD8;
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.22), rgba(34, 211, 238, 0.15));
  color: #FFFFFF;
  box-shadow: 0 0 15px rgba(255, 79, 216, 0.25);
}

.sachin-ai-role-option.full-span {
  grid-column: 1 / -1;
}

.sachin-ai-email-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 12, 28, 0.85);
  color: #FFFFFF;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sachin-ai-email-input:focus {
  border-color: #22D3EE;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

.sachin-ai-onboard-error {
  font-size: 0.78rem;
  color: #F87171;
  display: none;
}

.sachin-ai-start-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #FF4FD8 0%, #7C5CFF 55%, #22D3EE 100%);
  color: #FFFFFF;
  font-family: var(--font-heading, sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 79, 216, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sachin-ai-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.4);
}

/* ==========================================================================
   STEP 2: ACTIVE CONVERSATION STREAM & INPUT
   ========================================================================== */
.sachin-ai-chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sachin-ai-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.sachin-ai-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: chatMsgFadeIn 0.28s ease-out;
}

.sachin-ai-msg-row.user {
  flex-direction: row-reverse;
}

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

.sachin-ai-bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.sachin-ai-msg-row.assistant .sachin-ai-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: #F1F5F9;
  border-top-left-radius: 4px;
}

.sachin-ai-msg-row.user .sachin-ai-bubble {
  background: linear-gradient(135deg, #FF4FD8 0%, #7C5CFF 100%);
  color: #FFFFFF;
  border-top-right-radius: 4px;
  box-shadow: 0 6px 18px rgba(255, 79, 216, 0.25);
}

.sachin-ai-bubble h3,
.sachin-ai-bubble h4 {
  font-size: 0.92rem;
  color: #22D3EE;
  margin: 0 0 8px 0;
  line-height: 1.35;
}

.sachin-ai-bubble p {
  margin: 0 0 8px 0;
}

.sachin-ai-bubble p:last-child {
  margin-bottom: 0;
}

.sachin-ai-bubble ul {
  margin: 6px 0 8px 16px;
  padding: 0;
}

.sachin-ai-bubble li {
  margin-bottom: 5px;
}

.sachin-ai-bubble strong {
  color: #FF85E4;
}

.sachin-ai-msg-row.user .sachin-ai-bubble strong {
  color: #FFFFFF;
}

.sachin-ai-bubble code {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  background: rgba(34, 211, 238, 0.14);
  color: #22D3EE;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Action Links inside Bot Message */
.sachin-ai-msg-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sachin-ai-msg-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(34, 211, 238, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #22D3EE;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sachin-ai-msg-link:hover {
  background: #22D3EE;
  color: #0B0D24;
}

/* Typing Indicator */
.sachin-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 4px;
}

.sachin-ai-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22D3EE;
  animation: aiDotBounce 1.2s infinite ease-in-out;
}

.sachin-ai-typing span:nth-child(2) { animation-delay: 0.15s; background: #FF4FD8; }
.sachin-ai-typing span:nth-child(3) { animation-delay: 0.3s; background: #FFB020; }

@keyframes aiDotBounce {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.5; }
  40% { transform: scale(1.15); opacity: 1; }
}

/* Quick Prompt Chips Bar */
.sachin-ai-chips-bar {
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 18, 42, 0.65);
  scrollbar-width: none;
}

.sachin-ai-chips-bar::-webkit-scrollbar {
  display: none;
}

.sachin-ai-chip {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 79, 216, 0.35);
  background: rgba(255, 79, 216, 0.1);
  color: #F8FAFC;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sachin-ai-chip:hover {
  background: linear-gradient(135deg, #FF4FD8, #7C5CFF);
  border-color: transparent;
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Input Bar */
.sachin-ai-input-bar {
  padding: 12px 14px;
  background: rgba(9, 11, 28, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sachin-ai-text-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 13px;
  color: #FFFFFF;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.sachin-ai-text-input:focus {
  border-color: #22D3EE;
}

.sachin-ai-mic-btn,
.sachin-ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sachin-ai-mic-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
}

.sachin-ai-mic-btn.listening {
  background: rgba(239, 68, 68, 0.25);
  border-color: #EF4444;
  color: #F87171;
  animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.sachin-ai-send-btn {
  background: linear-gradient(135deg, #FF4FD8, #22D3EE);
  color: #0B0D24;
  font-weight: 800;
}

.sachin-ai-send-btn:hover {
  transform: scale(1.06);
}

/* ==========================================================================
   LIGHT MODE SUPPORT ([data-theme="light"])
   ========================================================================== */
[data-theme="light"] .sachin-ai-greeting-pill {
  background: rgba(255, 255, 255, 0.96);
  color: #0F172A;
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .sachin-ai-window {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(124, 92, 255, 0.3);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .sachin-ai-header {
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.1) 0%, rgba(34, 211, 238, 0.12) 100%);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .sachin-ai-header-title {
  color: #0F172A;
}

[data-theme="light"] .sachin-ai-header-sub {
  color: #0284C7;
}

[data-theme="light"] .sachin-ai-icon-btn {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

[data-theme="light"] .sachin-ai-welcome-bubble {
  background: #F8FAFC;
  border-color: rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .sachin-ai-welcome-text {
  color: #1E293B;
}

[data-theme="light"] .sachin-ai-welcome-text strong {
  color: #7C3AED;
}

[data-theme="light"] .sachin-ai-onboarding-form {
  background: #F8FAFC;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .sachin-ai-role-option {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.14);
  color: #1E293B;
}

[data-theme="light"] .sachin-ai-role-option.selected {
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.16), rgba(34, 211, 238, 0.16));
  border-color: #D946EF;
  color: #0F172A;
}

[data-theme="light"] .sachin-ai-email-input {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.2);
  color: #0F172A;
}

[data-theme="light"] .sachin-ai-msg-row.assistant .sachin-ai-bubble {
  background: #F1F5F9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #0F172A;
}

[data-theme="light"] .sachin-ai-bubble h3,
[data-theme="light"] .sachin-ai-bubble h4 {
  color: #0284C7;
}

[data-theme="light"] .sachin-ai-bubble strong {
  color: #C026D3;
}

[data-theme="light"] .sachin-ai-chips-bar {
  background: #F8FAFC;
  border-top-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .sachin-ai-chip {
  background: rgba(124, 92, 255, 0.08);
  border-color: rgba(124, 92, 255, 0.28);
  color: #1E293B;
}

[data-theme="light"] .sachin-ai-input-bar {
  background: #FFFFFF;
  border-top-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .sachin-ai-text-input {
  background: #F8FAFC;
  border-color: rgba(15, 23, 42, 0.16);
  color: #0F172A;
}

@media (max-width: 540px) {
  .sachin-ai-window {
    right: 12px;
    left: 12px;
    bottom: 92px;
    width: auto;
    height: 75vh;
  }
  .sachin-ai-greeting-pill {
    display: none;
  }
}
