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

:root {
    --bg: #070a0f;
    --panel: #0d1219;
    --panel-light: #121923;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f2f5f8;
    --muted: #8994a3;
    --accent: #5ac8fa;
    --accent-dark: #1877a8;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 50% -10%, #172d3c 0%, transparent 45%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app {
    width: 100%;
    max-width: 680px;
    height: 100vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    background: rgba(9, 13, 18, 0.94);
}


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

.header {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 18px;
    background: rgba(13, 18, 25, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(15px);
}

.menu-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.jarvis-logo {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #8de1ff, #269ed1 45%, #125779);
    color: white;
    font-size: 20px;
    font-weight: bold;
    box-shadow:
        0 0 18px rgba(90, 200, 250, 0.25),
        inset 0 0 12px rgba(255, 255, 255, 0.18);
}

.header h1 {
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 600;
}

.header p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.header p::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #46d369;
    box-shadow: 0 0 8px rgba(70, 211, 105, 0.8);
}


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

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #0d1219;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9999;
    padding: 20px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 20px;
    letter-spacing: 1px;
}

.sidebar-header button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.new-chat {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(
        145deg,
        #238fc1,
        #176b91
    );
    color: white;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 22px;
}

.new-chat:active {
    transform: scale(0.98);
}

.history-title {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}


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

#chat {
    flex: 1;
    overflow-y: auto;
    padding: 25px 17px 20px;
    scroll-behavior: smooth;
}

#chat::-webkit-scrollbar {
    width: 4px;
}

#chat::-webkit-scrollbar-thumb {
    background: #303a46;
    border-radius: 10px;
}

.message {
    display: flex;
    margin-bottom: 18px;
    animation: messageIn 0.25s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.assistant {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.bubble {
    max-width: 82%;
    padding: 13px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.55;
    word-wrap: break-word;
}

.assistant .bubble {
    background: linear-gradient(
        145deg,
        #171f29,
        #111820
    );
    border: 1px solid var(--border);
    border-top-left-radius: 5px;
    color: #e7edf3;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.18);
}

.user .bubble {
    background: linear-gradient(
        145deg,
        #238fc1,
        #176b91
    );
    border-top-right-radius: 5px;
    color: white;
    box-shadow:
        0 5px 18px rgba(24, 119, 168, 0.2);
}


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

#chatForm {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px 15px;
    background: rgba(13, 18, 25, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(15px);
}

#messageInput {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    outline: none;
    border-radius: 25px;
    padding: 0 18px;
    background: #151c25;
    color: var(--text);
    font-size: 15px;
    transition: 0.2s;
}

#messageInput:focus {
    border-color: rgba(90, 200, 250, 0.45);
    box-shadow:
        0 0 0 3px rgba(90, 200, 250, 0.07);
}

#messageInput::placeholder {
    color: #687483;
}

#chatForm button {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(
        145deg,
        #63d1ff,
        #238fc1
    );
    color: #061018;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow:
        0 4px 16px rgba(35, 143, 193, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}

#chatForm button:active {
    transform: scale(0.92);
}

#chatForm button:hover {
    box-shadow:
        0 5px 22px rgba(35, 143, 193, 0.4);
}


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

@media (max-width: 480px) {

    .header {
        padding: 13px 15px;
    }

    .menu-button {
        font-size: 23px;
    }

    .xyro-logo {
        width: 42px;
        height: 42px;
    }

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

    #chat {
        padding: 20px 12px;
    }

    .bubble {
        max-width: 88%;
        font-size: 14px;
    }

    #chatForm {
        padding: 10px;
    }

    .sidebar {
        width: 280px;
    }
}
.history-chat {
    width: 100%;
    padding: 12px;
    margin-bottom: 6px;
    border: none;
    border-radius: 8px;
    background: #151c25;
    color: #e7edf3;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.history-chat:active {
    background: #1d2936;
}