/* ========== Base ==========\ */
html,
body {
    overscroll-behavior-y: contain;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.875rem, 0.5vw + 0.8rem, 1rem);
    background: #f5f5f5;
}

/* Hero background (half-screen section uses this class) */
.bg-hero {
    background: url('/static/images/hero.png') center / cover no-repeat;
}

/* ========== Messages ==========\ */
.message {
    padding: 6px 12px;
    margin: 2px 0;
    border-radius: 6px;
    line-height: 1.4;
    display: inline-block;
    box-sizing: border-box;
}

.bot-message {
    background-color: #e0f2f7;
    /* light blue */
    align-self: flex-start;
    text-align: left;
    max-width: 95%;
}

.user-message {
    background-color: #fce4ec;
    /* light pink */
    align-self: flex-end;
    text-align: left;
    max-width: 95%;
}

/* Code blocks in bot messages */
.bot-message pre {
    background-color: #f3f3f6;
    padding: 0.5rem;
    border-radius: 0.375rem;
    overflow-x: auto;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: #e0f2f7;
    padding: 8px 12px;
    border-radius: 8px;
    width: fit-content;
    margin: 4px 0;
    min-width: 40px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: #888;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0)
    }

    40% {
        transform: scale(1)
    }
}

/* Font helpers */
.font-inter {
    font-family: 'Inter', sans-serif;
}

.font-roboto {
    font-family: 'Roboto', sans-serif;
}

/* Optional header helper */
.fluid-header {
    white-space: nowrap;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Step-number (kept if you use it elsewhere) */
.step-number {
    display: inline-block;
    width: 2em;
    height: 2em;
    line-height: 2em;
    border-radius: 50%;
    background-color: #3b82f6;
    color: white;
    text-align: center;
    margin-right: .5em;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    font-size: 1.5em;
}

/* ========== Chat layout ==========\ */
#chatContainer {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    /* prevent overflow from children */
}

#chatHistory,
#userbox {
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

/* Initial short height; your JS can grow it to 45vh after first send */
#chatHistory {
    height: 15vh;
    overflow: hidden;
    /* container hides; inner #chatbox scrolls */
}

#chatbox {
    overflow-y: auto;
}

/* Composer under history */
#userbox {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    /* small vertical space above composer */
    border-radius: 1rem;
    /* rounded corners */
    border: 1px solid #d1d5db;
    /* gray-300 border */
    background-color: #ffffff;
    /* white panel */
    padding: .5rem;
    /* ensure comfy padding */
}

/* Textarea inside composer */
#userbox #userInput {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
    max-height: 40vh;
    background-color: transparent;
    /* match parent bg */
    border: none;
    /* remove default border */
    outline: none;
    /* remove blue outline; rely on parent */
}

/* Buttons */
#userbox button {
    flex: 0 0 auto;
    white-space: nowrap;
}

#sendBtn {
    background-color: transparent;
    /* inherit parent bg */
    color: #2563eb;
    /* blue-600-ish for icon */
    border: none;
    cursor: pointer;
}

#sendBtn:hover {
    color: #1d4ed8;
}

/* darker on hover */

/* ========== Mobile menu ==========\ */
/* Mobile-only width cap + background */
#mobile-menu {
    width: 83.333%;
    /* ~w-10/12 */
    max-width: 240px;
    /* cap width on small screens */
    background-color: #f3f4f6;
    /* bg-gray-100 */
}

@media (min-width: 768px) {
    #mobile-menu {
        width: auto;
        max-width: none;
        background-color: transparent;
        left: auto;
        /* reset any mobile offsets */
        transform: none;
    }
}

/* ========== Divider with centered label ==========\ */
/* ========== Divider with centered label (gradient lines) ========== */
.divider {
    display: flex;
    align-items: center;
    gap: .5rem;
    /* smaller gap = longer lines */
    width: 100%;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1 1 0;
    /* fill remaining width */
    height: 2px;
}

/* Left line: solid near the text, fades toward the left edge */
.divider::before {
    background: linear-gradient(to left, teal 60%, rgba(20, 184, 166, 0));
}

/* Right line: solid near the text, fades toward the right edge */
.divider::after {
    background: linear-gradient(to right, teal 60%, rgba(20, 184, 166, 0));
}

.divider>span {
    padding: 0 .5rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: teal;
    color: #fff;
    border-radius: .5rem;
}