/* --- Styles Généraux et Réinitialisations --- */
body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background-color: #0A0A0A;
    color: #E0E0E0;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

*, *::before, *::after {
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    cursor: pointer;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

input {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background-color: #1A1A1A;
    color: #E0E0E0;
}

input::placeholder {
    color: #909090;
}

/* --- Header avec informations IA --- */
header {
    padding: 15px 25px;
    background-color: #111111;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 990;
    position: sticky;
    top: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 650px;
    margin: 0 auto;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2E8B57, #1e5a3a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 3px 10px rgba(46, 139, 87, 0.3);
}

.ai-info h3 {
    margin: 0;
    font-size: 1.2em;
    color: #FFFFFF;
}

.status-indicator {
    font-size: 0.85em;
    color: #4CAF50;
    display: flex;
    align-items: center;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* --- Boutons d'icônes en haut à droite --- */
.top-right-buttons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: linear-gradient(135deg, #1A1A1A, #0A0A0A);
    border: 1px solid #282828;
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    color: #E0E0E0;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #2E8B57, #246B44);
}

/* --- Conteneur du Chat Principal --- */
#chat-container {
    flex-grow: 1;
    max-width: 650px;
    margin: 0 auto 100px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
}

/* --- Boîte de Chat --- */
#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 20px;
    background-color: transparent;
    scroll-behavior: smooth;
}

/* Styles pour la scrollbar */
#chat-box::-webkit-scrollbar {
    width: 6px;
}

#chat-box::-webkit-scrollbar-track {
    background: #1A1A1A;
    border-radius: 3px;
}

#chat-box::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 3px;
}

#chat-box::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* --- Messages --- */
.message {
    margin: 15px 0;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    margin-left: auto;
    text-align: right;
}

.ai-message {
    margin-right: auto;
    text-align: left;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    font-size: 1em;
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #2E8B57, #246B44);
    color: #FFFFFF;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(46, 139, 87, 0.3);
}

.ai-message .message-content {
    background: linear-gradient(135deg, #1A1A1A, #141414);
    color: #E0E0E0;
    border: 1px solid #282828;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message-time {
    font-size: 0.75em;
    opacity: 0.7;
    margin-top: 5px;
}

/* --- Messages de suggestion (boutons cliquables) --- */
.suggestion-message {
    margin: 10px 0;
    max-width: 85%;
    margin-right: auto;
}

.suggestion-content {
    background: linear-gradient(135deg, #1A1A1A, #141414);
    border: 1px solid #333333;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.suggestion-title {
    color: #2E8B57;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.suggestion-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-btn {
    background: linear-gradient(135deg, #252525, #1A1A1A);
    border: 1px solid #333333;
    color: #E0E0E0;
    padding: 10px 15px;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    position: relative;
    overflow: hidden;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #2E8B57, #246B44);
    border-color: #2E8B57;
    transform: translateX(5px);
    box-shadow: 0 3px 12px rgba(46, 139, 87, 0.3);
}

.suggestion-btn:active {
    transform: translateX(3px);
}

/* --- Zone de saisie --- */
#input-area {
    background: linear-gradient(135deg, #1A1A1A, #111111);
    border-radius: 20px;
    padding: 15px;
    border: 1px solid #282828;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

#user-input {
    flex-grow: 1;
    padding: 12px 20px;
    border: 1px solid #333333;
    border-radius: 25px;
    background-color: #0F0F0F;
    color: #E0E0E0;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
}

#user-input:focus {
    border-color: #2E8B57;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2);
}

#send-button {
    background: linear-gradient(135deg, #2E8B57, #246B44);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(46, 139, 87, 0.3);
}

#send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(46, 139, 87, 0.4);
}

#send-button:active {
    transform: scale(0.95);
}

/* --- Indicateur de frappe --- */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1A1A1A, #141414);
    border: 1px solid #282828;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    margin: 15px 0;
    max-width: 80px;
    animation: slideIn 0.3s ease-out;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #2E8B57;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* --- Liens dans les messages --- */
.message-content a {
    color: #4CAF50;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.message-content a:hover {
    border-bottom-color: #4CAF50;
}

/* --- Navigation Inférieure --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #111111;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 999;
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.4);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid #282828;
}

.bottom-nav .nav-item {
    color: #888888;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    padding: 8px 5px;
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-grow: 1;
    max-width: 90px;
}

.bottom-nav .nav-item img {
    filter: invert(70%);
    margin-bottom: 5px;
    width: 26px;
    height: 26px;
    transition: filter 0.3s ease;
}

.bottom-nav .nav-item span {
    font-size: 0.9em;
    font-weight: 500;
}

.bottom-nav .nav-item:hover {
    background-color: #1A1A1A;
    color: #E0E0E0;
    transform: translateY(-3px);
}

.bottom-nav .nav-item:hover img {
    filter: invert(100%);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    header {
        padding: 12px 20px;
    }
    
    .ai-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .ai-info h3 {
        font-size: 1.1em;
    }
    
    .top-right-buttons {
        gap: 8px;
    }
    
    .icon-btn {
        width: 35px;
        height: 35px;
        padding: 8px;
    }
    
    #chat-container {
        padding: 15px;
        height: calc(100vh - 140px);
    }
    
    .message {
        max-width: 90%;
    }
    
    .suggestion-message {
        max-width: 95%;
    }
    
    #input-area {
        padding: 12px;
    }
    
    #user-input {
        padding: 10px 16px;
        font-size: 0.95em;
    }
    
    #send-button {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
    }
    
    .ai-info h3 {
        font-size: 1em;
    }
    
    .status-indicator {
        font-size: 0.8em;
    }
    
    #chat-container {
        padding: 10px;
        height: calc(100vh - 120px);
    }
    
    .message-content {
        padding: 10px 14px;
        font-size: 0.95em;
    }
    
    .suggestion-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    #input-area {
        padding: 10px;
    }
    
    .input-container {
        gap: 8px;
    }
}
