
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0b0b12;
    color: #f4f4f5;
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */

.sidebar {
    width: 270px;
    background: #11111b;
    border-right: 1px solid #252536;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 55px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    font-size: 24px;
    font-weight: bold;
}

.brand h2 {
    font-size: 21px;
}

.brand span {
    color: #85859b;
    font-size: 11px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.section-title {
    color: #a1a1b5;
    font-size: 12px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select {
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    background: #1b1b29;
    color: white;
    border: 1px solid #303047;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

select:focus,
input:focus {
    border-color: #8b5cf6;
}

.sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    color: #a1a1b5;
    font-size: 13px;
    padding-top: 20px;
    border-top: 1px solid #252536;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}

/* MAIN */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.topbar {
    height: 85px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #252536;
}

.topbar-label {
    color: #8b5cf6;
    font-size: 10px;
    letter-spacing: 2px;
}

.topbar h2 {
    font-size: 19px;
    margin-top: 4px;
}

.version-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    background: #171724;
    border: 1px solid #29293d;
    border-radius: 30px;
    font-size: 12px;
    color: #c4c4d4;
}

/* CONVERSATION */

.conversation {
    flex: 1;
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    padding: 45px 35px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.welcome {
    margin: auto;
    text-align: center;
    padding: 30px 0;
}

.welcome-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin: 0 auto 25px;
    border-radius: 22px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    font-size: 35px;
    box-shadow: 0 0 45px #8b5cf633;
}

.welcome h1 {
    font-size: 30px;
    margin-bottom: 12px;
}

.welcome p {
    color: #9292a7;
    font-size: 15px;
}

#chat {
    width: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#chat p {
    max-width: 85%;
    padding: 15px 18px;
    border-radius: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.user-message {
    align-self: flex-end;
    background: #30234f;
    border: 1px solid #5b3e91;
}

.ai-message {
    align-self: flex-start;
    background: #191925;
    border: 1px solid #303047;
}

/* MESSAGE BOX */

.composer-area {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    padding: 20px 35px 25px;
}

.message-box {
    display: flex;
    gap: 12px;
    padding: 9px;
    background: #171722;
    border: 1px solid #303047;
    border-radius: 16px;
}

input {
    flex: 1;
    min-width: 0;
    padding: 13px;
    background: transparent;
    border: 1px solid transparent;
    color: white;
    outline: none;
    font-size: 15px;
}

input::placeholder {
    color: #77778c;
}

button {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 11px;
    padding: 0 23px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.disclaimer {
    color: #66667a;
    text-align: center;
    font-size: 11px;
    margin-top: 14px;
}

/* SCROLLBAR */

#chat::-webkit-scrollbar {
    width: 6px;
}

#chat::-webkit-scrollbar-thumb {
    background: #39394d;
    border-radius: 10px;
}

/* MOBILE */

@media (max-width: 700px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 18px;
        border-right: none;
        border-bottom: 1px solid #252536;
    }

    .brand {
        margin-bottom: 22px;
    }

    .sidebar-bottom {
        margin-top: 15px;
    }

    .topbar {
        padding: 0 20px;
    }

    .conversation {
        padding: 30px 18px;
    }

    .composer-area {
        padding: 15px 18px 20px;
    }

    .welcome h1 {
        font-size: 23px;
    }

    .message-box {
        gap: 7px;
    }

    button {
        padding: 0 15px;
    }
}

@media (max-width: 400px) {
    .message-box {
        flex-direction: column;
    }

    button {
        padding: 13px;
    }
}

/* HISTORIQUE DES DISCUSSIONS */

.new-chat-button {
    width: 100%;
    padding: 13px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 11px;
    font-weight: bold;
}

.history-section {
    flex: 1;
    min-height: 100px;
    overflow-y: auto;
    margin-bottom: 25px;
}

.empty-history {
    color: #77778c;
    font-size: 13px;
    padding: 12px 5px;
}

.history-item {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 7px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #b7b7c9;
    text-align: left;
    font-size: 13px;
    font-weight: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item:hover {
    background: #1b1b29;
    transform: none;
}

.history-item.active {
    background: #29213e;
    border-color: #5b3e91;
    color: white;
}

.history-section::-webkit-scrollbar {
    width: 5px;
}

.history-section::-webkit-scrollbar-thumb {
    background: #39394d;
    border-radius: 10px;
}
