/* --- VARIABLES ET STYLES GLOBAUX --- */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&display=swap');

:root {
    --background-color: #131314;
    --sidebar-bg: #1e1f20;
    --user-message-bg: #3c4655;
    --gemini-message-bg: #2d2f30;
    --text-color: #e3e3e3;
    --subtle-text-color: #9aa0a6;
    --input-bg: #1e1f20;
    --input-border-color: #5f6368;
    --button-bg: #333437;
    --button-bg-hover: #454647;
    --accent-purple: #a041ea;
    --gemini-gradient: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

html, body {
    font-family: 'Google Sans', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--background-color);
    color: var(--text-color);
}

.page-container {
    height: 90vh;
    width: 100%;
}

.table{

}
/* --- STYLES "MOBILE-FIRST" (Par défaut) --- */

.page-container {
    display: flex; /* La base est flex pour le contenu principal */
    flex-direction: column;
}

.main-content {
    flex-grow: 1; /* Le contenu principal prend toute la hauteur disponible */
    display: flex;
    flex-direction: column;
    width:100%;
    min-height: 0; /* Correction pour le scroll dans un conteneur flex */
}

.mobile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--sidebar-bg);
    flex-shrink: 0;
}


.site-title-mobile {
    font-size: 1.2rem;
    font-weight: 500;
}

.menu-button {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

    .menu-button svg {
        width: 24px;
        height: 24px;
    }



.tools-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid var(--input-border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .tool-item:hover {
        background-color: var(--gemini-message-bg);
    }

    .tool-item svg {
        width: 20px;
        height: 20px;
        color: var(--subtle-text-color);
        flex-shrink: 0;
    }



.new-chat-button {
    width: 100%;
    padding: 12px;
    background-color: var(--gemini-message-bg);
    border: none;
    color: var(--text-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .new-chat-button:hover {
        background-color: var(--button-bg);
    }

.history-list {
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    padding: 0.75rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

    .history-item:hover {
        background-color: var(--gemini-message-bg);
    }

.gemini-chat-page {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

/* ================================================== */
/* DÉBUT DE LA MODIFICATION : Barre de titre ajoutée */
/* ================================================== */
.chat-title-bar {
    text-align: center;
    background-color: var(--sidebar-bg); /* Utilise la même couleur que la sidebar pour la cohérence */
}

    .chat-title-bar h3 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 500;
        color: var(--text-color);
    }
/* ================================================ */
/* FIN DE LA MODIFICATION                           */
/* ================================================ */

.chat-area {
    flex-grow: 1;
    overflow-y: auto;
   /* padding: 1rem;*/ 
}

.messages-list {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message-bubble {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    line-height: 1.7;
    max-width: 85%;
}

.gemini-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-content {
    padding: 14px 18px;
    max-width: 100%;
    font-size: 1.05rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.gemini-message .message-content {
    border-radius: 8px 16px 16px 16px;
}

.user-message .message-content {
    border-radius: 16px 8px 16px 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 500;
    flex-shrink: 0;
}

.user-message .avatar {
    background-color: var(--accent-purple);
    color: white;
}

.user-message .message-content {
    background-color: var(--user-message-bg);
}

.gemini-message .avatar {
    background: var(--gemini-gradient);
}

.gemini-message .message-content {
    background-color: var(--gemini-message-bg);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

    .typing-indicator span {
        height: 8px;
        width: 8px;
        background-color: var(--subtle-text-color);
        border-radius: 50%;
        animation: bounce 1.4s infinite ease-in-out both;
    }

        .typing-indicator span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: -0.16s;
        }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}
/* Nouveau conteneur pour le pied de page du chat */
.chat-footer {
    flex-shrink: 0; /* Empêche le pied de page de rétrécir */
    padding: 0 1rem; /* Applique le padding ici */
    padding: 0 1rem; /* Applique le padding ici */
    background-color: var(--background-color); /* Assure une couleur de fond solide */
}

/* Le padding est maintenant sur le footer, on le retire de l'input */
.input-container {
    padding: 1rem 0 0 0; /* On garde que le padding du haut */
}


.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 10px 10px 20px;
    background-color: var(--input-bg);
    border-radius: 28px;
    border: 1px solid var(--input-border-color);
    transition: border-color 0.3s;
}

    .input-wrapper:focus-within {
        border-color: #8ab4f8;
    }

.message-input {
    flex-grow: 1;
    border: none;
    outline: none;
    background-color: transparent;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1.1rem;
    resize: none;
    max-height: 200px;
    overflow-y: auto;
    padding-top: 4px;
    line-height: 1.5;
}

.send-button {
    background-color: var(--button-bg);
    width: 36px;
    height: 36px;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

    .send-button:hover:not(:disabled) {
        background-color: var(--button-bg-hover);
    }

    .send-button:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

    .send-button svg {
        width: 20px;
        height: 20px;
        fill: #e3e3e3;
    }

/* Le disclaimer a maintenant un max-width qui fonctionne mieux dans le footer */
.disclaimer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--subtle-text-color);
    max-width: 800px;
    margin: 0 auto;
}


/* --- STYLES RESPONSIVES (POUR ORDINATEUR) --- */
@media (min-width: 851px) {
    .page-container {
        display: grid;
        
    }

   

    .mobile-header {
        display: none;
    }

    

    .main-content {
       
        width: 100%;
    }
}
body {
    font-family: 'Inter', sans-serif;
    background-color: #111827; /* bg-gray-900 */
}

/* Barre de défilement personnalisée pour les navigateurs Webkit (Chrome, Safari) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #111827; /* bg-gray-900 */
}

::-webkit-scrollbar-thumb {
    background: #374151; /* bg-gray-700 */
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #4b5563; /* bg-gray-600 */
    }
