/* =========================================================================
   bCloud AI Assistant — chat widget styles
   - Responsive: full-screen on mobile, floating panel on desktop
   - Matches the reference design: rounded header, light bot bubbles,
     blue pill buttons, send arrow, privacy footer.
   ========================================================================= */

   :root {
    --bc-primary: #2563eb;
    --bc-primary-dark: #1d4ed8;
    --bc-primary-light: #dbeafe;
    --bc-bg: rgba(255, 255, 255, 0.85); /* Semi-transparent for glass effect */
    --bc-bubble-bot: #f1f5f9;
    --bc-bubble-user: #2563eb;
    --bc-text: #0f172a;
    --bc-text-muted: #64748b;
    --bc-border: rgba(229, 231, 235, 0.5);
    --bc-header-bg: rgba(244, 235, 224, 0.9);
    --bc-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    --bc-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }
  
  /* Glassmorphism utility */
  .glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--bc-border);
  }
  
  /* ---------- Demo page (not part of the embeddable widget) ----------------- */
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: var(--bc-font);
    color: var(--bc-text);
    background:
      radial-gradient(1200px 600px at 80% -100px, #dbeafe 0%, transparent 60%),
      radial-gradient(1000px 500px at 0% 100%, #ede9fe 0%, transparent 55%),
      #ffffff;
    min-height: 100vh;
  }
  .demo-page { max-width: 1180px; margin: 0 auto; padding: 24px; }
  .demo-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0;
  }
  .demo-logo {
    display: flex; align-items: center; gap: 6px;
    font-weight: 700; font-size: 20px; letter-spacing: -0.01em;
  }
  .demo-logo-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--bc-primary), #7c3aed);
    color: #fff; font-weight: 800;
  }
  .demo-nav-links { display: flex; gap: 24px; align-items: center; }
  .demo-nav-links a {
    color: var(--bc-text); text-decoration: none; font-weight: 500; font-size: 15px;
  }
  .demo-btn-primary {
    background: var(--bc-text); color: #fff !important;
    padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  }
  .demo-btn-ghost {
    color: var(--bc-text); font-weight: 600; text-decoration: none;
  }
  .demo-hero { padding: 80px 0 120px; max-width: 760px; }
  .demo-badge {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    background: #fff; border: 1px solid var(--bc-border);
    font-size: 13px; font-weight: 500; margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  }
  .demo-hero h1 {
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05; margin: 0 0 24px; letter-spacing: -0.03em; font-weight: 700;
  }
  .demo-hero h1 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--bc-primary), #7c3aed);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .demo-sub { font-size: 18px; color: var(--bc-text-muted); margin: 0 0 32px; line-height: 1.6; }
  .demo-cta-row { display: flex; gap: 16px; flex-wrap: wrap; }
  @media (max-width: 640px) {
    .demo-nav-links a:not(.demo-btn-primary) { display: none; }
    .demo-hero { padding: 40px 0 80px; }
  }
  
  /* ========================================================================= */
  /* ---------- Widget launcher (floating bubble) ---------------------------- */
  /* ========================================================================= */
  .bc-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: auto; /* Changed from 70px to auto so it fits the text */
    height: 60px;
    padding: 0 24px 0 16px; /* Adds space around the icon and text */
    background: whitesmoke; /* Solid Black Background */
    border: 2px solid #fff;
    border-radius: 999px; /* Creates the Pill shape */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); /* Soft black shadow, NO MORE BLUE */
    overflow: visible;
    cursor: pointer;
    z-index: 9998;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* MAGIC CENTERING FIX */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .bc-launcher-inner {
    display: flex;
    align-items: center;
    gap: 0px; /* Space between the white star and the text */
  }
  .button-avatar {
    transform: scale(1.4);
    flex-shrink: 0;
    display: block;
  }
  .bc-launcher:hover {
    /* NEW: Lifts a bit higher to emphasize the smoothness */
    transform: translateY(-4px) scale(1.03); 
    background: whitesmoke;
    border: 2px solid #91b9ff;

  }
  .bc-launcher.is-hidden { opacity: 0; pointer-events: none; transform: scale(0.7); }
  .bc-launcher-pulse {
    position: absolute; inset: 0; border-radius: 50%;
    background: var(--bc-primary); opacity: 0.4;
    animation: bc-pulse 2.4s ease-out infinite;
    pointer-events: none;
  }
  @keyframes bc-pulse {
    0%   { transform: scale(1);   opacity: 0.4; }
    100% { transform: scale(1.8); opacity: 0;   }
  }
  /* ========================================= */
  /* Tooltip Message Box                       */
  /* ========================================= */
  .bc-tooltip {
    position: absolute;
    bottom: 85px; /* Pushes the message just above the floating icon */
    right: 0px;   /* Keeps it aligned with the right side of the screen */
    width: 270px;
    background: #000000; /* Pure black to perfectly match the button */
    border: 1px solid #333333; /* Subtle dark gray border */
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    text-align: left;
    cursor: default; 
  
    /* This keeps it hidden until hovered */
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  /* This makes the box appear smoothly when hovering the main button */
  .bc-launcher:hover .bc-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  
  /* Tooltip Text Formatting */
  .bc-tooltip-title {
    display: block;
    font-family: var(--bc-font, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
  }
  .bc-tooltip-title:hover{
    color:#ffffff;
  }
  
  .bc-tooltip-text {
    display: block;
    font-family: var(--bc-font, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 400;
    color: #ffffff; /* Soft light gray so the paragraph is easy to read */
    line-height: 1.5;
  }

  /* Styles for the "Ask me" text */
  .bc-launcher-text {
    color: #000;
    font-family: var(--bc-font, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap; /* Prevents the text from wrapping to a second line */
  }

  /* ========================================================================= */
/* ---------- Responsive: mobile takes the full screen --------------------- */
/* ========================================================================= */
@media (max-width: 520px) {
  .bc-widget {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100dvh;          /* full viewport on phones */
    max-height: 100dvh;
    border-radius: 0;
  }
  
  /* PERFECT MOBILE PILL BUTTON */
  .bc-launcher {
    bottom: 16px;
    right: 16px;
    width: auto;             /* Keeps the pill shape! */
    height: 52px;            /* Slightly thinner for small screens */
    padding: 0 18px 0 12px;  /* Tighter spacing for phones */
  }

  /* Scales down the text slightly for mobile */
  .bc-launcher-text {
    font-size: 14px;
  }

  /* Hides the hover tooltip on mobile (touchscreens don't have mouse hover) */
  .bc-tooltip {
    display: none;
  }

  .bc-msg-bubble { max-width: 82%; font-size: 15px; }
  .bc-actions { padding: 4px 14px 10px; }
  .bc-chip { padding: 10px 16px; font-size: 14px; }
}

/* Slightly larger touch targets on tablets */
@media (min-width: 521px) and (max-width: 900px) {
  .bc-widget { width: 360px; height: 600px; }
}

  /* ========================================================================= */
  /* ---------- Widget panel -------------------------------------------------- */
  /* ========================================================================= */
  .bc-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-height: min(640px, calc(100vh - 48px));
    height: 640px;
    background: var(--bc-bg);
    border-radius: 18px;
    box-shadow: var(--bc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: var(--bc-font);
    /* Hidden by default */
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .bc-widget.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  
  /* ---------- Header -------------------------------------------------------- */
  .bc-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    background: var(--bc-header-bg);
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }
  .bc-header-info { display: flex; align-items: center; gap: 12px; }
  .bc-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
    overflow: hidden;
  }
  .bc-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .bc-header-text { line-height: 1.1; }
  .bc-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--bc-text); }
  .bc-subtitle { margin: 1px 0 0; font-size: 10.5px; color: var(--bc-text-muted); }
  .bc-close {
    background: transparent; border: none; cursor: pointer;
    color: var(--bc-text-muted); padding: 6px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
  }
  .bc-close:hover { background: rgba(0,0,0,0.06); color: var(--bc-text); }
  
  /* ---------- Messages list ------------------------------------------------- */
  .bc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    scroll-behavior: smooth;
  }
  .bc-messages::-webkit-scrollbar { width: 6px; }
  .bc-messages::-webkit-scrollbar-thumb {
    background: rgba(15,23,42,0.15); border-radius: 3px;
  }
  
  .bc-msg {
    display: flex; gap: 10px; width: 100%;
    animation: bc-fade-in 0.3s ease;
  }
  @keyframes bc-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .bc-msg--bot { justify-content: flex-start; }
  .bc-msg--user { justify-content: flex-end; }
  
  .bc-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--bc-primary), #7c3aed);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
  }
  .bc-msg--user .bc-msg-avatar { display: none; }
  
  .bc-msg-bubble {
    background: var(--bc-bubble-bot);
    color: var(--bc-text);
    padding: 8px 12px;
    font-size: 12.5px;
    line-height: 1.35;
    width: auto;
    max-width: 85%;
    word-wrap: break-word;
    white-space: normal;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    flex-shrink: 0;
  }
  .bc-msg--user .bc-msg-bubble {
    background: var(--bc-bubble-user);
    color: #fff;
    border-radius: 18px 18px 2px 18px;
    align-self: flex-end;
    margin-left: auto;
  }
  .bc-msg--bot .bc-msg-bubble {
    border-radius: 18px 18px 18px 2px;
    align-self: flex-start;
  }
  .bc-msg-bubble a {
    color: var(--bc-primary-dark);
    text-decoration: underline;
  }
  .bc-msg-bubble strong {
    font-weight: 700;
  }
  .bc-msg-bubble p {
    margin: 0 0 6px 0;
  }
  .bc-msg-bubble p:last-child {
    margin-bottom: 0;
  }
  .bc-msg-bubble ul {
    margin: 4px 0;
    padding-left: 18px;
  }
  .bc-msg-bubble li {
    margin-bottom: 2px;
  }
  .bc-msg-bubble li:last-child {
    margin-bottom: 0;
  }
  .bc-msg--user .bc-msg-bubble a { color: #fff; }
  
  /* Typing indicator (three bouncing dots) */
  .bc-typing {
    display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px;
  }
  .bc-typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--bc-text-muted); opacity: 0.6;
    animation: bc-bounce 1.2s infinite;
  }
  .bc-typing span:nth-child(2) { animation-delay: 0.15s; }
  .bc-typing span:nth-child(3) { animation-delay: 0.3s; }
  @keyframes bc-bounce {
    0%, 60%, 100% { transform: translateY(0);   opacity: 0.4; }
    30%           { transform: translateY(-4px); opacity: 1;   }
  }
  
  /* ---------- Quick action chips ------------------------------------------- */
  .bc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 14px 10px;
    background: #fff;
    overflow-x: hidden;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none;  /* Hide scrollbar for IE/Edge */
  }
  .bc-actions::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
  }
  .bc-chip {
    background: var(--bc-primary);
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    font-family: inherit;
    flex-shrink: 0;
  }
  .bc-chip:hover { background: var(--bc-primary-dark); }
  .bc-chip:active { transform: scale(0.97); }
  .bc-chip:disabled { opacity: 0.6; cursor: not-allowed; }
  
  /* ---------- Input area --------------------------------------------------- */
  .bc-input-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px 4px;
    background: #fff;
  }
  .bc-input {
    flex: 1;
    border: 1.5px solid var(--bc-primary);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    color: var(--bc-text);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .bc-input:focus {
    border-color: var(--bc-primary-dark);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  }
  .bc-input::placeholder { color: #94a3b8; }
  .bc-send {
    background: transparent;
    border: none;
    color: var(--bc-primary);
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .bc-send:hover { background: var(--bc-primary-light); }
  .bc-send:active { transform: scale(0.92); }
  .bc-send:disabled { color: #94a3b8; cursor: not-allowed; }
  
  /* ---------- Footer ------------------------------------------------------- */
  .bc-footer {
    margin: 0;
    padding: 4px 14px 8px;
    font-size: 10px;
    color: var(--bc-text-muted);
    line-height: 1.3;
    background: #fff;
    border-top: 1px solid var(--bc-border);
  }
  .bc-footer a { color: var(--bc-text); text-decoration: underline; }
  
  /* ========================================================================= */
/* ---------- Responsive: mobile takes the full screen --------------------- */
/* ========================================================================= */
@media (max-width: 520px) {
  .bc-widget {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100dvh;          /* full viewport on phones */
    max-height: 100dvh;
    border-radius: 0;
  }
  
  /* PERFECT MOBILE PILL BUTTON */
  .bc-launcher {
    bottom: 16px;
    right: 16px;
    width: auto;             /* Keeps the pill shape! */
    height: 52px;            /* Slightly thinner for small screens */
    padding: 0 18px 0 12px;  /* Tighter spacing for phones */
  }

  /* Scales down the text slightly for mobile */
  .bc-launcher-text {
    font-size: 14px;
  }

  /* Hides the hover tooltip on mobile */
  .bc-tooltip {
    display: none;
  }

  .bc-msg-bubble { max-width: 82%; font-size: 15px; }
  .bc-actions { padding: 4px 14px 10px; }
  .bc-chip { padding: 10px 16px; font-size: 14px; }
}

/* Slightly larger touch targets on tablets */
@media (min-width: 521px) and (max-width: 900px) {
  .bc-widget { width: 360px; height: 600px; }
}
  