/* /bestill/assets/css/bestill.css */

:root {
    --bg: #050608;
    --bg-panel: #0d1016;
    --accent: #ab68ff;
    --accent-soft: rgba(171, 104, 255, 0.16);
    --text: #f5f5f7;
    --muted: #9ca3af;
    --user: #f2e6ff;
    --bot: #e5e7eb;
    --border: #222222;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    background: #050608; /* base background, glow handled by ::before */
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}


/* --- Top Glow (circular, pulsing, purple) --- */
body::before {
    content: "";
    position: fixed;
    top: -10%;              /* sits above the header */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;            /* fixed circle size */
    height: 100%;           /* same as width → perfect circle */
    pointer-events: none;
    z-index: -1;

    background: radial-gradient(
        circle at top,
        rgba(255, 255, 255, 0.10) 0%,
        rgba(234, 214, 255, 0.25) 14%,
        rgba(171, 104, 255, 0.40) 28%,
        rgba(161, 60, 255, 0.48) 38%,
        rgba(40, 0, 90, 0.92) 52%,
        rgba(0, 0, 0, 1) 75%
    );

    opacity: 0.33;
    animation: topGlowPulse 8s ease-in-out infinite;
    filter: blur(25px);       /* optional: makes it smoother */
}

/* Smooth pulse */
@keyframes topGlowPulse {
    0% {
        opacity: 0.29;
        transform: translateX(-50%) scale(0.96);
    }
    50% {
        opacity: 0.52;
        transform: translateX(-50%) scale(1.03);
    }
    100% {
        opacity: 0.29;
        transform: translateX(-50%) scale(0.96);
    }
}

.bs-app {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0rem 1rem 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Full-width header bar */
.bs-header {
    width: 100%;
    background: #000000;
    box-shadow: 0 18px 45px rgba(0,0,0,0.6);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 20;
    margin-bottom: 1rem;
}

.bs-header a {
    color: #9ca3af;
    text-decoration: none;
    font-weight: bold;
}

.bs-header a:hover {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

/* Constrained inner header content (matches bs-app width) */
.bs-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom-right-radius: 0.75rem;
    border-bottom-left-radius: 0.75rem;
}

.bs-header h1 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: 0.06em;
}

.bs-header p {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.bs-main {
    flex: 1;
    min-height: 0;
}

.bs-messages {
    height: calc(100vh - 220px);
    padding: 1rem;
    /*border-radius: 0.75rem;*/
    background: none/*var(--bg-panel)*/;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}


@media (max-width: 640px) {
    
    .bs-messages {
        height: calc(100vh - 320px);
        padding: 1rem 0rem;
         border-left: none;
         border-right: none;
    }
}

/* message bubbles */

.bs-msg {
    padding: 0.75rem 0.9rem;
    border-radius: 0.65rem;
    max-width: 90%;
    font-size: 0.95rem;
    line-height: 1.5;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.04);
    opacity: 0;
    transform: translateY(14px);
    animation: msgFadeDown 1.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    will-change: opacity, transform;
}

.bs-msg .bs-msg-body {
    white-space: pre-wrap;
}

.bs-msg .bs-msg-body.bs-msg-html {
    white-space: normal; /* let HTML paragraphs control their own flow */
}

.bs-msg-user {
    align-self: flex-end;
    background: rgba(171, 104, 255, 0.12);
    color: var(--user);
    /*border: 1px solid rgba(171, 104, 255, 0.4);*/
}

.bs-msg-bot {
    align-self: flex-start;
    background: rgba(0, 0, 0, 0.35);
    color: var(--bot);
    /*border: 1px solid var(--border);*/
}

.bs-msg-meta {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.bs-form {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-top: 1rem;
}

#bs-input {
    flex: 1;
    resize: none;
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    background: #05070b;
    color: var(--text);
    font-size: 0.95rem;
}

#bs-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(171,104,255,0.35);
}

#bs-send {
    border: none;
    border-radius: 0.75rem;
    padding: 0 1.2rem;
    background: #853dd8; 
    color: #13061f;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.08s ease;
    font-size: 1.1rem;
    color: #ffffff;
}

#bs-send:disabled {
    opacity: 0.5;
    cursor: default;
}

#bs-send:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.5);
}

.bs-header-right img.bs-header-logo {
    max-height: 75px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 768px) {
  .bs-header-right img.bs-header-logo {
    max-width: 50px;
  }
}

.bs-header-right img.bs-header-logo:hover {
    opacity: 1;
    transform: scale(1.04);
}

.bs-header-left {
    display: flex;
    flex-direction: column;
}

@keyframes msgFadeIn {
    0% {
        opacity: 0;
        transform: translateY(14px);
    }
    60% {
        opacity: 1;
        transform: translateY(-2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes msgFadeDown {
    0% {
        opacity: 0;
        transform: translateY(10px); /* start slightly below */
    }
    100% {
        opacity: 1;
        transform: translateY(0);    /* end in place, no overshoot */
    }
}

/* BOT MESSAGE BODY – base text style */
.bs-msg-bot .bs-msg-body {
    line-height: 1.5;
}

/* Markdown / HTML answers: let them layout normally, wrapper handles animation */
.bs-msg-body.bs-msg-html {
    white-space: normal; /* already set above, but safe to restate */
}

/* Keep this as a no-op so JS can still add the class safely */
/*.bs-msg-body.bs-msg-html.bs-msg-html-visible {
     no extra animation needed – .bs-msg wrapper already fades/slides in 
}*/

/* Keyframes for a gentle fade-in from slightly lower on the screen */
@keyframes bs-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bs-thinking-body {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.bs-thinking-dots {
    display: inline-flex;
    gap: 0.18rem;
}

.bs-thinking-dots span {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(234, 214, 255, 0.9);
    opacity: 0.2;
    animation: thinkingDotPulse 1.2s infinite ease-in-out;
}

.bs-thinking-dots span:nth-child(2) {
    animation-delay: 0.18s;
}

.bs-thinking-dots span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes thinkingDotPulse {
    0%   { opacity: 0.2; transform: translateY(0); }
    40%  { opacity: 1;   transform: translateY(-1px); }
    80%  { opacity: 0.3; transform: translateY(0); }
    100% { opacity: 0.2; transform: translateY(0); }
}





/* ---------------------------------
   Suggestion cards (empty-state helper)
---------------------------------- */

.bs-suggestions {
    margin: 0 0 1rem 0;
}

.bs-suggestions-header {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0.75rem 0 0.35rem 0.25rem;
}

.bs-suggestions-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.6rem 0 3rem;          /* 👈 padding above & below cards */
    margin: 0.5rem 0 1.5rem;           /* 👈 margin to separate from header + chat */
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.bs-suggestion-card {
    scroll-snap-align: start;
    min-width: 260px;
    max-width: 280px;
    padding: 0.75rem 0.9rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.32);
    cursor: pointer;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        border-color 0.12s ease,
        background-color 0.12s ease;
}


.bs-suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.7);
    border-color: rgba(171, 104, 255, 0.7);
    background-color: rgba(15, 23, 42, 0.96);
}

.bs-suggestion-card:active {
    transform: translateY(0);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6);
}

.bs-suggestion-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.bs-suggestion-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #f9fafb;
}

/* Hide scrollbar – WebKit (Chrome / Safari) */
.bs-suggestions::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar – Firefox / Edge */
.bs-suggestions {
    -ms-overflow-style: none; /* IE / old Edge */
    scrollbar-width: none;    /* Firefox */
}

/* ---------------------------------
   Markdown / HTML content styling
   inside chat bubbles
---------------------------------- */

.bs-msg p {
    margin: 0 0 1rem;
}

.bs-msg p:last-child {
    margin-bottom: 0;
}

.bs-msg h1,
.bs-msg h2,
.bs-msg h3,
.bs-msg h4 {
    margin: 0.35rem 0 0.4rem;
    line-height: 1.25;
    font-weight: 650;
    color: #ffffff;
}

.bs-msg h1 { font-size: 1.2rem; }
.bs-msg h2 { font-size: 1.1rem; }
.bs-msg h3 { font-size: 1.0rem; }
.bs-msg h4 { font-size: 0.95rem; }

/* Lists from Markdown */
.bs-msg ul,
.bs-msg ol {
    margin: 0.15rem 0rem 1rem 1.1rem;
    padding-left: 0.9rem;
}

.bs-msg li {
    margin: 0.05rem 0 0.12rem;
}

/* Emphasis */
.bs-msg strong {
    font-weight: 650;
    color: #ffffff; /* soft warm highlight */
}

.bs-msg em {
    font-style: italic;
}

/* Horizontal rule (--- in Markdown) */
.bs-msg hr {
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    margin: 0.7rem 0;
}

/* Code (if it ever appears) */
.bs-msg code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    background: rgba(15, 23, 42, 0.9);
    padding: 0.05rem 0.25rem;
    border-radius: 0.25rem;
}