/* --- RESET ET CONFIGURATION GLOBALE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #0f172a;
    color: white;
    min-height: 100vh;
    padding-bottom: 130px; 
}

.app {
    width: 100%;
    max-width: 900px;
    height: calc(100vh - 150px);
    margin: 20px auto;
    background: #111827;
    border: 1px solid #263244;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- HEADER --- */
.header {
    padding: 20px;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

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

.header p {
    margin-top: 5px;
    color: #94a3b8;
    font-size: 14px;
}

.header .btn {
    color: #60a5fa;
    text-decoration: underline;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 14px;
}

.status span {
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
}

/* --- CHAT --- */
.chat {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

/* --- AVATAR MASCOTTE --- */
.avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #3b82f6;
    border: 2px solid #38bdf8; /* Joli contour lumineux pour la mascotte */
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message.ai .avatar {
    background: #0ea5e9;
}

.bubble {
    padding: 12px 16px;
    background: #1e293b;
    border-radius: 14px;
    line-height: 1.5;
}

.message.user .bubble {
    background: #2563eb;
}

/* --- ZONE DE SAISIE --- */
.input-bar {
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    padding: 12px 16px;
    background-color: #1e1e1e;
    box-sizing: border-box;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #2d2d2d;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.input-bar textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #333333;
    border-radius: 24px;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    background-color: #2a2a2a;
    color: #ffffff;
}

.input-bar textarea::placeholder {
    color: #888888;
}

.input-bar button {
    padding: 12px 20px;
    border: none;
    border-radius: 24px;
    background-color: #007bff;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.input-bar button:hover {
    background-color: #0056b3;
}

/* --- BARRE DE NAVIGATION --- */
#snap-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    background-color: #0f0f0f;
    border-top: 1px solid #222222;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    z-index: 99999;
    box-sizing: border-box;
}

.snap-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #747474;
    height: 100%;
    width: 100%;
    transition: color 0.15s ease-in-out;
}

.snap-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    margin-bottom: 3px;
}

.snap-item span {
    font-size: 10px;
    font-weight: 600;
}

.snap-item:hover,
.snap-item.active {
    color: #FFFC00;
}

.chat-btn-capsule {
    background: #FFFC00;
    color: #000000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(255, 252, 0, 0.25);
}

.chat-btn-capsule svg {
    width: 14px;
    height: 14px;
    fill: #000000;
    margin-bottom: 0;
}

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    #snap-nav-bar, 
    .input-bar {
        max-width: 900px;
        left: 50%;
        transform: translateX(-50%);
        border-left: 1px solid #2d2d2d;
        border-right: 1px solid #2d2d2d;
    }
}
/* --- MASCOTTE DANS LE HEADER --- */
.header-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-mascot {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #38bdf8;
    flex-shrink: 0;
}