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


/* ---------- VARIABLES ---------- */

:root {
    --black: #000000;
    --deep-black: #050505;

    --surface: #0b0b0b;
    --surface-2: #111111;
    --surface-3: #181818;

    --white: #ffffff;
    --soft-white: #eeeeee;

    --silver: #a0a0a0;
    --muted: #666666;

    --border: #272727;
    --border-light: #353535;
}


/* ---------- PAGE ---------- */

html,
body {
    width: 100%;
    height: 100%;
}


body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% 0%,
            #202020 0%,
            #0b0b0b 35%,
            #000000 75%
        );

    color: var(--white);

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    display: flex;

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

    padding: 20px;

    overflow: hidden;
}


/* ---------- APP ---------- */

.app {
    position: relative;

    width: 100%;
    max-width: 540px;

    height: min(900px, 92vh);

    background:
        linear-gradient(
            145deg,
            #151515,
            #080808
        );

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

    border-radius: 26px;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.85),
        0 10px 35px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}


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

.header {
    flex-shrink: 0;

    padding: 17px 20px;

    background:
        linear-gradient(
            145deg,
            #191919,
            #0b0b0b
        );

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

    display: flex;

    align-items: center;

    justify-content: space-between;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.45);

    z-index: 5;
}


/* ---------- BRAND ---------- */

.brand {
    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;
}


/* ---------- LOGO ---------- */

.logo {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;

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

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #d9d9d9
        );

    color: #000000;

    border-radius: 12px;

    font-family:
        "Trebuchet MS",
        Arial,
        sans-serif;

    font-size: 18px;

    font-weight: 800;

    box-shadow:
        0 7px 16px rgba(0, 0, 0, 0.55),
        inset 0 -3px 0 rgba(0, 0, 0, 0.12),
        inset 0 1px 0 #ffffff;
}


/* ---------- TITLE ---------- */

.header h1 {
    font-family:
        "Trebuchet MS",
        Arial,
        sans-serif;

    font-size: 20px;

    font-weight: 700;

    letter-spacing: 3px;

    line-height: 1;
}


.header p {
    margin-top: 5px;

    color: var(--muted);

    font-size: 10px;

    letter-spacing: 0.8px;
}


/* =========================================
   STATUS
   ========================================= */

.status {
    display: flex;

    align-items: center;

    gap: 6px;

    flex-shrink: 0;

    color: #8d8d8d;

    font-size: 10px;

    letter-spacing: 0.5px;
}


.status-dot {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    background: #ffffff;

    border-radius: 50%;

    box-shadow:
        0 0 8px rgba(255, 255, 255, 0.8);

    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        box-shadow 0.2s ease;
}


/* ---------- THINKING STATUS ---------- */

.status-dot.thinking {
    animation:
        statusPulse 0.9s infinite ease-in-out;
}


@keyframes statusPulse {

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

        opacity: 0.4;

        box-shadow:
            0 0 4px rgba(255, 255, 255, 0.4);
    }

    50% {
        transform: scale(1.45);

        opacity: 1;

        box-shadow:
            0 0 14px rgba(255, 255, 255, 0.9);
    }
}


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

.chat-box {
    flex: 1;

    min-height: 0;

    padding: 24px 20px;

    overflow-y: auto;

    display: flex;

    flex-direction: column;

    gap: 15px;

    scroll-behavior: smooth;

    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}


/* ---------- SCROLLBAR ---------- */

.chat-box::-webkit-scrollbar {
    width: 5px;
}


.chat-box::-webkit-scrollbar-track {
    background: transparent;
}


.chat-box::-webkit-scrollbar-thumb {
    background: #303030;

    border-radius: 20px;
}


.chat-box::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}


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

.message {
    position: relative;

    max-width: 82%;

    padding: 13px 15px;

    border-radius: 18px;

    font-size: 14px;

    line-height: 1.6;

    word-wrap: break-word;

    overflow-wrap: anywhere;

    animation:
        messageAppear 0.25s ease;

    will-change:
        transform,
        opacity;
}


/* ---------- MESSAGE ANIMATION ---------- */

@keyframes messageAppear {

    from {
        opacity: 0;

        transform:
            translateY(8px)
            scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}


/* =========================================
   NOVA MESSAGE
   ========================================= */

.bot {
    align-self: flex-start;

    background:
        linear-gradient(
            145deg,
            #202020,
            #111111
        );

    color: var(--soft-white);

    border: 1px solid #303030;

    border-bottom-left-radius: 5px;

    box-shadow:
        8px 10px 22px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.bot:hover {
    transform: translateY(-1px);

    border-color: #3a3a3a;

    box-shadow:
        8px 12px 28px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}


/* ---------- NOVA NAME ---------- */

.message-name {
    display: block;

    margin-bottom: 6px;

    color: #ffffff;

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 1.5px;

    opacity: 0.5;
}


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

.user {
    align-self: flex-end;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #e5e5e5
        );

    color: #080808;

    border: 1px solid #ffffff;

    border-bottom-right-radius: 5px;

    box-shadow:
        -8px 10px 22px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 #ffffff;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.user:hover {
    transform: translateY(-1px);
}


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

.typing-message {
    min-width: 72px;
}


.typing {
    display: flex;

    align-items: center;

    justify-content: flex-start;

    gap: 5px;

    height: 18px;
}


.typing span {
    width: 6px;
    height: 6px;

    background: #d5d5d5;

    border-radius: 50%;

    animation:
        typingBounce 1.15s infinite ease-in-out;
}


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


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


.typing span:nth-child(3) {
    animation-delay: 0.28s;
}


@keyframes typingBounce {

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

        opacity: 0.35;
    }

    30% {
        transform: translateY(-5px);

        opacity: 1;
    }
}


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

.input-area {
    flex-shrink: 0;

    padding: 12px 14px;

    background:
        linear-gradient(
            180deg,
            #121212,
            #090909
        );

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

    display: flex;

    align-items: center;

    gap: 9px;

    z-index: 5;
}


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

.input-area input {
    flex: 1;

    min-width: 0;

    height: 48px;

    padding: 0 16px;

    background: #050505;

    color: #ffffff;

    border: 1px solid #2c2c2c;

    border-radius: 16px;

    outline: none;

    font-family:
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 14px;

    box-shadow:
        inset 0 3px 8px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(255, 255, 255, 0.03);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.input-area input::placeholder {
    color: #5f5f5f;
}


.input-area input:focus {
    border-color: #666666;

    box-shadow:
        inset 0 3px 8px rgba(0, 0, 0, 0.55),
        0 0 0 3px rgba(255, 255, 255, 0.045),
        0 0 18px rgba(255, 255, 255, 0.025);
}


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

.input-area button {
    flex-shrink: 0;

    width: 78px;

    height: 48px;

    border: none;

    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #dddddd
        );

    color: #000000;

    font-family:
        "Trebuchet MS",
        Arial,
        sans-serif;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 1px;

    cursor: pointer;

    box-shadow:
        0 7px 15px rgba(0, 0, 0, 0.5),
        inset 0 -3px 0 rgba(0, 0, 0, 0.12),
        inset 0 1px 0 #ffffff;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.2s ease;
}


.input-area button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.6),
        0 0 18px rgba(255, 255, 255, 0.08),
        inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}


.input-area button:active {
    transform: translateY(1px);

    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.6);
}


.input-area button:disabled {
    cursor: not-allowed;

    opacity: 0.45;

    transform: none;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.4);
}


.input-area button.ready {
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.55),
        0 0 20px rgba(255, 255, 255, 0.09),
        inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}


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

@media (max-width: 600px) {

    body {
        padding: 0;

        align-items: stretch;

        overflow: hidden;
    }


    .app {
        width: 100%;

        height: 100vh;

        height: 100dvh;

        max-width: none;

        border-radius: 0;

        border: none;
    }


    .header {
        padding:
            15px 16px;
    }


    .chat-box {
        padding:
            20px 15px;
    }


    .message {
        max-width: 86%;
    }


    .input-area {
        padding:
            10px;
    }


    .input-area input {
        font-size: 16px;
    }
}


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

@media (max-width: 360px) {

    .logo {
        width: 38px;
        height: 38px;
    }


    .header h1 {
        font-size: 18px;
    }


    .status {
        display: none;
    }


    .input-area button {
        width: 68px;
    }


    .message {
        max-width: 90%;

        font-size: 13px;
    }
}


/* =========================================
   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;
    }
    }
