/* =========================================
   FOUNTAIN AI — CHAT INTERFACE
   CHAT.CSS — PART 1
========================================= */


/* =========================================
   ROOT VARIABLES
========================================= */

:root {

    --bg-main: #070a12;
    --bg-sidebar: #0b0f19;
    --bg-card: #111722;
    --bg-input: #101621;

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);

    --text-primary: #ffffff;
    --text-secondary: #a9b1c1;
    --text-muted: #70798b;

    --accent: #6c63ff;
    --accent-light: #8b85ff;

    --user-message: #242a3a;

    --sidebar-width: 280px;

    --transition:
        0.25s ease;

}


/* =========================================
   RESET
========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    width: 100%;
    min-height: 100vh;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg-main);
    color: var(--text-primary);

    overflow: hidden;

}


/* =========================================
   LINKS & BUTTONS
========================================= */

a {
    color: inherit;
    text-decoration: none;
}


button,
textarea {
    font: inherit;
}


button {
    border: none;
    cursor: pointer;
}


/* =========================================
   APP LOADER
========================================= */

#app-loader {

    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 14px;

    background: var(--bg-main);

    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;

}


#app-loader.hidden {

    opacity: 0;
    visibility: hidden;

}


.loader-logo {

    width: 70px;
    height: 70px;

    display: flex;

    align-items: center;
    justify-content: center;

    animation:
        loaderPulse 1.5s ease-in-out infinite;

}


.loader-logo img {

    width: 100%;
    height: 100%;

    object-fit: contain;

}


.loader-text {

    font-size: 20px;

    font-weight: 700;

    letter-spacing: 0.3px;

}


.loader-bar {

    width: 130px;
    height: 3px;

    overflow: hidden;

    border-radius: 20px;

    background:
        rgba(255, 255, 255, 0.08);

}


.loader-bar span {

    display: block;

    width: 45%;
    height: 100%;

    border-radius: inherit;

    background: var(--accent);

    animation:
        loaderBar 1.2s ease-in-out infinite;

}


@keyframes loaderPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }

}


@keyframes loaderBar {

    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(300%);
    }

}


/* =========================================
   MAIN CHAT APP
========================================= */

.chat-app {

    width: 100%;
    height: 100vh;

    display: flex;

    background:
        radial-gradient(
            circle at 70% 20%,
            rgba(108, 99, 255, 0.06),
            transparent 35%
        );

}


/* =========================================
   SIDEBAR
========================================= */

.chat-sidebar {

    width: var(--sidebar-width);

    height: 100vh;

    flex-shrink: 0;

    display: flex;

    flex-direction: column;

    padding: 18px;

    background: var(--bg-sidebar);

    border-right:
        1px solid var(--border);

    transition:
        transform var(--transition);

    z-index: 100;

}


/* =========================================
   SIDEBAR TOP
========================================= */

.sidebar-top {

    display: flex;

    flex-direction: column;

    gap: 22px;

}


.sidebar-brand {

    display: flex;

    align-items: center;

    gap: 11px;

    padding: 5px;

}


.sidebar-brand img {

    width: 42px;
    height: 42px;

    object-fit: contain;

}


.sidebar-brand div {

    display: flex;

    flex-direction: column;

    gap: 2px;

}


.sidebar-brand strong {

    font-size: 16px;

    font-weight: 750;

}


.sidebar-brand span {

    font-size: 11px;

    color: var(--text-muted);

}


/* =========================================
   NEW CHAT BUTTON
========================================= */

.new-chat-btn {

    width: 100%;

    min-height: 45px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    border:
        1px solid var(--border);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.035);

    color: var(--text-primary);

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);

}


.new-chat-btn span:first-child {

    font-size: 21px;

    font-weight: 300;

}


.new-chat-btn:hover {

    background:
        rgba(108, 99, 255, 0.12);

    border-color:
        rgba(108, 99, 255, 0.35);

    transform: translateY(-1px);

}


/* =========================================
   CONVERSATION SECTION
========================================= */

.conversation-section {

    flex: 1;

    min-height: 0;

    margin-top: 28px;

    overflow-y: auto;

}


.conversation-title {

    padding: 0 8px 10px;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 0.8px;

    text-transform: uppercase;

    color: var(--text-muted);

}


/* =========================================
   CONVERSATION LIST
========================================= */

.conversation-list {

    display: flex;

    flex-direction: column;

    gap: 4px;

}


.conversation-item {

    width: 100%;

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 10px 9px;

    text-align: left;

    border-radius: 9px;

    background: transparent;

    color: var(--text-secondary);

    transition:
        background var(--transition),
        color var(--transition);

}


.conversation-item:hover {

    background:
        rgba(255, 255, 255, 0.05);

    color: var(--text-primary);

}


.conversation-item.active {

    background:
        rgba(108, 99, 255, 0.12);

    color: var(--text-primary);

}


.conversation-icon {

    width: 20px;

    flex-shrink: 0;

    text-align: center;

    font-size: 16px;

}


.conversation-name {

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 13px;

}


/* =========================================
   SIDEBAR BOTTOM
========================================= */

.sidebar-bottom {

    padding-top: 16px;

}


.sidebar-link {

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 10px 8px;

    border-radius: 8px;

    color: var(--text-secondary);

    font-size: 13px;

    transition:
        background var(--transition),
        color var(--transition);

}


.sidebar-link:hover {

    background:
        rgba(255, 255, 255, 0.05);

    color: var(--text-primary);

}


.sidebar-divider {

    width: 100%;
    height: 1px;

    margin: 14px 0;

    background:
        var(--border);

}


.powered-by {

    display: flex;

    flex-direction: column;

    gap: 3px;

    padding: 0 8px;

}


.powered-by span {

    font-size: 10px;

    color: var(--text-muted);

}


.powered-by strong {

    font-size: 11px;

    font-weight: 600;

    color: var(--text-secondary);

}


.sidebar-fmn-logo {

    display: block;

    max-width: 105px;
    max-height: 35px;

    margin: 10px 8px 0;

    object-fit: contain;

    opacity: 0.8;

}


/* =========================================
   SCROLLBAR
========================================= */

.conversation-section::-webkit-scrollbar {

    width: 5px;

}


.conversation-section::-webkit-scrollbar-thumb {

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.1);

}


.conversation-section::-webkit-scrollbar-track {

    background: transparent;

}
/* =========================================
   FOUNTAIN AI — CHAT.CSS
   PART 2
========================================= */


/* =========================================
   MAIN CHAT AREA
========================================= */

.chat-main {

    flex: 1;

    min-width: 0;
    height: 100vh;

    display: flex;
    flex-direction: column;

    position: relative;

}


/* =========================================
   CHAT HEADER
========================================= */

.chat-header {

    height: 70px;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 24px;

    border-bottom:
        1px solid var(--border);

    background:
        rgba(7, 10, 18, 0.82);

    backdrop-filter:
        blur(16px);

    -webkit-backdrop-filter:
        blur(16px);

    z-index: 20;

}


.chat-title {

    display: flex;

    align-items: center;

    gap: 11px;

}


.chat-title img {

    width: 38px;
    height: 38px;

    object-fit: contain;

}


.chat-title div {

    display: flex;

    flex-direction: column;

    gap: 2px;

}


.chat-title h1 {

    font-size: 15px;

    line-height: 1.2;

    font-weight: 750;

}


.chat-title span {

    font-size: 11px;

    color: var(--text-muted);

}


/* =========================================
   HEADER ACTIONS
========================================= */

.chat-header-actions {

    display: flex;

    align-items: center;

    gap: 8px;

}


.header-action {

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background:
        rgba(255, 255, 255, 0.035);

    color: var(--text-secondary);

    font-size: 19px;

    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        transform var(--transition);

}


.header-action:hover {

    background:
        rgba(108, 99, 255, 0.12);

    color: var(--text-primary);

    border-color:
        rgba(108, 99, 255, 0.3);

    transform: rotate(25deg);

}


/* =========================================
   MOBILE MENU BUTTON
========================================= */

.mobile-menu-btn {

    display: none;

    width: 38px;
    height: 38px;

    align-items: center;
    justify-content: center;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background:
        rgba(255, 255, 255, 0.035);

    color: var(--text-primary);

    font-size: 19px;

}


/* =========================================
   MESSAGES CONTAINER
========================================= */

.messages-container {

    flex: 1;

    min-height: 0;

    overflow-y: auto;

    position: relative;

    scroll-behavior: smooth;

}


.messages-container::-webkit-scrollbar {

    width: 7px;

}


.messages-container::-webkit-scrollbar-thumb {

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.1);

}


.messages-container::-webkit-scrollbar-track {

    background: transparent;

}


/* =========================================
   WELCOME SCREEN
========================================= */

.welcome-screen {

    width: min(720px, 92%);

    margin: 0 auto;

    min-height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    padding: 60px 20px 40px;

    text-align: center;

}


.welcome-logo {

    width: 76px;
    height: 76px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 20px;

    animation:
        welcomeFloat 4s ease-in-out infinite;

}


.welcome-logo img {

    width: 100%;
    height: 100%;

    object-fit: contain;

}


@keyframes welcomeFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }

}


.welcome-screen h2 {

    margin-bottom: 8px;

    font-size:
        clamp(25px, 4vw, 34px);

    line-height: 1.15;

    font-weight: 800;

    letter-spacing: -0.7px;

}


.welcome-screen > p {

    margin-bottom: 30px;

    font-size: 14px;

    color: var(--text-secondary);

}


/* =========================================
   SUGGESTION GRID
========================================= */

.suggestion-grid {

    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 10px;

}


.suggestion-card {

    min-height: 82px;

    display: flex;

    align-items: center;

    gap: 13px;

    padding: 15px;

    text-align: left;

    border:
        1px solid var(--border);

    border-radius: 13px;

    background:
        rgba(255, 255, 255, 0.025);

    color: var(--text-primary);

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition);

}


.suggestion-card:hover {

    transform:
        translateY(-3px);

    background:
        rgba(108, 99, 255, 0.08);

    border-color:
        rgba(108, 99, 255, 0.3);

}


.suggestion-card > span {

    width: 36px;
    height: 36px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        rgba(108, 99, 255, 0.1);

    font-size: 17px;

}


.suggestion-card div {

    min-width: 0;

    display: flex;

    flex-direction: column;

    gap: 4px;

}


.suggestion-card strong {

    font-size: 13px;

    font-weight: 700;

}


.suggestion-card small {

    font-size: 11px;

    line-height: 1.4;

    color: var(--text-muted);

}


/* =========================================
   MESSAGE LIST
========================================= */

.messages-list {

    width: min(850px, 94%);

    margin: 0 auto;

    padding: 30px 0 30px;

}


.message {

    width: 100%;

    display: flex;

    gap: 12px;

    margin-bottom: 26px;

    animation:
        messageAppear 0.3s ease both;

}


@keyframes messageAppear {

    from {

        opacity: 0;

        transform:
            translateY(8px);

    }

    to {

        opacity: 1;

        transform:
            translateY(0);

    }

}


/* =========================================
   MESSAGE AVATAR
========================================= */

.message-avatar {

    width: 34px;
    height: 34px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    overflow: hidden;

}


.message-avatar img {

    width: 100%;
    height: 100%;

    object-fit: contain;

}


/* =========================================
   USER AVATAR
========================================= */

.user-message .message-avatar {

    background:
        rgba(255, 255, 255, 0.08);

    color: var(--text-secondary);

    font-size: 16px;

}


/* =========================================
   MESSAGE CONTENT
========================================= */

.message-content {

    min-width: 0;

    max-width: 78%;

}


.message-name {

    margin-bottom: 5px;

    font-size: 11px;

    font-weight: 700;

    color: var(--text-muted);

}


.message-text {

    font-size: 14px;

    line-height: 1.7;

    color: var(--text-primary);

    overflow-wrap: anywhere;

}


/* =========================================
   USER MESSAGE
========================================= */

.user-message {

    justify-content: flex-end;

}


.user-message .message-content {

    order: 1;

}


.user-message .message-avatar {

    order: 2;

}


.user-message .message-text {

    padding: 12px 15px;

    border-radius:
        16px 16px 4px 16px;

    background:
        var(--user-message);

    color: var(--text-primary);

}


/* =========================================
   AI MESSAGE
========================================= */

.ai-message {

    justify-content: flex-start;

}


.ai-message .message-text {

    padding-top: 1px;

}


.ai-message .message-avatar {

    background:
        rgba(108, 99, 255, 0.08);

}


/* =========================================
   TYPING INDICATOR
========================================= */

.typing-wrapper {

    width: min(850px, 94%);

    margin: 0 auto;

    display: none;

    align-items: flex-start;

    gap: 12px;

    padding-bottom: 25px;

}


.typing-wrapper.visible {

    display: flex;

}


.typing-bubble {

    min-width: 62px;

    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 4px;

    padding: 0 13px;

    border:
        1px solid var(--border);

    border-radius:
        6px 15px 15px 15px;

    background:
        rgba(255, 255, 255, 0.035);

}


.typing-bubble span {

    width: 5px;
    height: 5px;

    border-radius: 50%;

    background:
        var(--text-muted);

    animation:
        typingDot 1.3s infinite ease-in-out;

}


.typing-bubble span:nth-child(2) {

    animation-delay:
        0.15s;

}


.typing-bubble span:nth-child(3) {

    animation-delay:
        0.3s;

}


@keyframes typingDot {

    0%,
    60%,
    100% {

        transform:
            translateY(0);

        opacity: 0.35;

    }

    30% {

        transform:
            translateY(-4px);

        opacity: 1;

    }

}
/* =========================================
   FOUNTAIN AI — CHAT.CSS
   PART 3 — FINAL
========================================= */


/* =========================================
   CHAT INPUT AREA
========================================= */

.chat-input-area {

    flex-shrink: 0;

    width: 100%;

    padding:
        14px 24px 18px;

    background:
        linear-gradient(
            to top,
            var(--bg-main) 75%,
            transparent
        );

}


/* =========================================
   INPUT WRAPPER
========================================= */

.input-wrapper {

    width: min(850px, 94%);

    min-height: 54px;

    margin: 0 auto;

    display: flex;

    align-items: flex-end;

    gap: 8px;

    padding:
        8px 8px 8px 16px;

    border:
        1px solid var(--border);

    border-radius: 16px;

    background:
        var(--bg-input);

    box-shadow:
        0 8px 35px rgba(0, 0, 0, 0.18);

    transition:
        border-color var(--transition),
        box-shadow var(--transition);

}


.input-wrapper:focus-within {

    border-color:
        rgba(108, 99, 255, 0.45);

    box-shadow:
        0 8px 40px rgba(108, 99, 255, 0.08);

}


/* =========================================
   MESSAGE TEXTAREA
========================================= */

#messageInput {

    flex: 1;

    width: 100%;

    min-width: 0;

    min-height: 38px;

    max-height: 180px;

    resize: none;

    overflow-y: auto;

    padding:
        9px 0;

    border: none;

    outline: none;

    background: transparent;

    color:
        var(--text-primary);

    font-size: 14px;

    line-height: 1.5;

}


#messageInput::placeholder {

    color:
        var(--text-muted);

}


#messageInput::-webkit-scrollbar {

    width: 4px;

}


#messageInput::-webkit-scrollbar-thumb {

    background:
        rgba(255, 255, 255, 0.12);

    border-radius: 10px;

}


/* =========================================
   SEND BUTTON
========================================= */

.send-btn {

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background:
        var(--accent);

    color:
        #ffffff;

    font-size: 18px;

    line-height: 1;

    transition:
        transform var(--transition),
        background var(--transition),
        opacity var(--transition);

}


.send-btn:hover {

    background:
        var(--accent-light);

    transform:
        translateY(-2px);

}


.send-btn:active {

    transform:
        translateY(0) scale(0.94);

}


.send-btn:disabled {

    opacity: 0.45;

    cursor: not-allowed;

    transform: none;

}


/* =========================================
   INPUT DISCLAIMER
========================================= */

.input-disclaimer {

    width: min(850px, 94%);

    margin:
        8px auto 0;

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 6px;

    text-align: center;

    font-size: 10px;

    line-height: 1.4;

    color:
        var(--text-muted);

}


/* =========================================
   SIDEBAR OVERLAY
========================================= */

.sidebar-overlay {

    position: fixed;

    inset: 0;

    z-index: 90;

    background:
        rgba(0, 0, 0, 0.6);

    backdrop-filter:
        blur(3px);

    -webkit-backdrop-filter:
        blur(3px);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity var(--transition),
        visibility var(--transition);

}


.sidebar-overlay.visible {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

}


/* =========================================
   SELECTION
========================================= */

::selection {

    background:
        rgba(108, 99, 255, 0.35);

    color:
        #ffffff;

}


/* =========================================
   FOCUS ACCESSIBILITY
========================================= */

button:focus-visible,
a:focus-visible,
textarea:focus-visible {

    outline:
        2px solid var(--accent-light);

    outline-offset:
        2px;

}


/* =========================================
   TABLET
========================================= */

@media (max-width: 900px) {

    :root {

        --sidebar-width: 250px;

    }


    .chat-header {

        padding:
            0 18px;

    }


    .messages-list,
    .typing-wrapper,
    .input-wrapper,
    .input-disclaimer {

        width: 92%;

    }


    .message-content {

        max-width: 82%;

    }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 700px) {

    body {

        overflow: hidden;

    }


    .chat-sidebar {

        position: fixed;

        top: 0;
        left: 0;

        width: min(
            290px,
            86vw
        );

        transform:
            translateX(-105%);

        box-shadow:
            15px 0 40px rgba(0, 0, 0, 0.3);

    }


    .chat-sidebar.open {

        transform:
            translateX(0);

    }


    .mobile-menu-btn {

        display: flex;

        flex-shrink: 0;

    }


    .chat-header {

        height: 62px;

        padding:
            0 13px;

        gap: 10px;

    }


    .chat-title {

        flex: 1;

    }


    .chat-title img {

        width: 34px;
        height: 34px;

    }


    .chat-title h1 {

        font-size: 14px;

    }


    .chat-title span {

        font-size: 10px;

    }


    .header-action {

        width: 35px;
        height: 35px;

    }


    .welcome-screen {

        width: 94%;

        padding:
            35px 8px 25px;

    }


    .welcome-logo {

        width: 64px;
        height: 64px;

        margin-bottom: 16px;

    }


    .welcome-screen h2 {

        font-size: 25px;

    }


    .welcome-screen > p {

        margin-bottom: 22px;

        font-size: 13px;

    }


    .suggestion-grid {

        grid-template-columns:
            1fr;

        gap: 8px;

    }


    .suggestion-card {

        min-height: 68px;

        padding: 12px;

    }


    .messages-list {

        width: 94%;

        padding:
            20px 0 25px;

    }


    .typing-wrapper {

        width: 94%;

    }


    .message {

        gap: 9px;

        margin-bottom: 21px;

    }


    .message-avatar {

        width: 30px;
        height: 30px;

        border-radius: 8px;

    }


    .message-content {

        max-width: 84%;

    }


    .message-text {

        font-size: 13px;

        line-height: 1.6;

    }


    .user-message .message-text {

        padding:
            10px 12px;

    }


    .chat-input-area {

        padding:
            8px 10px 12px;

    }


    .input-wrapper {

        width: 100%;

        min-height: 50px;

        padding:
            6px 6px 6px 13px;

        border-radius: 14px;

    }


    #messageInput {

        font-size: 14px;

        min-height: 36px;

    }


    .send-btn {

        width: 36px;
        height: 36px;

    }


    .input-disclaimer {

        width: 100%;

        font-size: 9px;

        gap: 4px;

    }

}


/* =========================================
   SMALL PHONES
========================================= */

@media (max-width: 400px) {

    .chat-header {

        padding:
            0 9px;

    }


    .chat-title {

        gap: 7px;

    }


    .chat-title img {

        width: 30px;
        height: 30px;

    }


    .chat-title h1 {

        font-size: 13px;

    }


    .header-action {

        width: 33px;
        height: 33px;

        font-size: 17px;

    }


    .welcome-screen h2 {

        font-size: 22px;

    }


    .suggestion-card strong {

        font-size: 12px;

    }


    .suggestion-card small {

        font-size: 10px;

    }


    .message-content {

        max-width: 86%;

    }


    .input-disclaimer span:nth-child(2) {

        display: none;

    }

}


/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        scroll-behavior:
            auto !important;

        transition-duration:
            0.01ms !important;

    }

}