@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* Style général avec police Inter (similaire à DeepSeek) */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif; 
    display: flex; 
    height: 100vh; 
    background: #ffffff; 
    line-height: 1.5;
    color: #1f1f1f;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar style DeepSeek */
.sidebar { 
    width: 260px; 
    background-color: #f8f9fa; 
    border-right: 1px solid #e8eaed; 
    display: flex; 
    flex-direction: column; 
    padding: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e8eaed;
}

.sidebar h2 { 
    font-size: 16px; 
    color: #10A85C;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.new-chat-btn { 
    background: #10A85C; 
    color: white; 
    border: none; 
    border-radius: 8px; 
    padding: 10px 16px; 
    margin-top: 12px;
    font-size: 14px; 
    cursor: pointer; 
    font-weight: 500;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
    width: 100%;
    text-align: left;
}

.new-chat-btn:hover {
    background: #0d8c4d;
}

.new-chat-btn i {
    margin-right: 8px;
}

.conversation-list { 
    flex: 1; 
    overflow-y: auto; 
    padding: 8px;
}

.conversation { 
    padding: 12px; 
    background: transparent; 
    border-radius: 8px; 
    margin-bottom: 4px; 
    cursor: pointer; 
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 14px;
}

.conversation:hover {
    background: #e8f5e8;
}

.conversation.active { 
    background: rgba(16, 168, 92, 0.08);
    color: #1f1f1f;
    border: 1px solid rgba(16, 168, 92, 0.3);
    font-weight: 500;
}

.conversation.active:hover {
    background: rgba(16, 168, 92, 0.12);
}

/* Main chat style DeepSeek */
.main { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 0;
    background: #ffffff;
}

.welcome { 
    margin-top: 120px; 
    text-align: center; 
    font-size: 20px; 
    color: #666; 
    max-width: 600px; 
    font-weight: 400;
    line-height: 1.4;
}

.chat-box { 
    width: 100%; 
    max-width: 800px; 
    margin-top: 0;
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 20px;
}

/* Messages style DeepSeek */
.message { 
    display: flex; 
    margin: 24px 0; 
    padding: 0 20px;
}

.assistant { 
    flex-direction: row; 
}

.user { 
    flex-direction: row-reverse; 
}

/* AVATARS EN CERCLE SANS FOND */
.avatar { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    margin: 0 12px; 
    object-fit: cover;
    background: transparent !important;
}

.bubble { 
    background: #f8f9fa; 
    padding: 16px 20px; 
    border-radius: 12px; 
    max-width: 85%; 
    white-space: pre-wrap; 
    font-size: 15px; 
    line-height: 1.6;
    font-weight: 400;
    border: 1px solid #e8eaed;
    white-space: pre-wrap;

}

.user .bubble { 
    background: rgba(16, 168, 92, 0.08);
    color: #1f1f1f;
    border: 1px solid rgba(16, 168, 92, 0.15);
    backdrop-filter: blur(10px);
}

/* Indicateur de typing style DeepSeek */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    color: #666;
    font-size: 14px;
    font-weight: 400;
}

.typing-dots {
    display: flex;
    margin-left: 8px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #666;
    margin: 0 2px;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input bar style DeepSeek */
.bottom-bar { 
    width: 100%; 
    max-width: 800px; 
    position: relative; 
    margin: 20px auto; 
    display: flex; 
    gap: 8px; 
    padding: 0 20px;
}

#prompt { 
    flex: 1; 
    padding: 16px 20px; 
    border-radius: 12px; 
    font-size: 16px; 
    border: 1px solid #e8eaed; 
    outline: none; 
    background: white;
    font-family: inherit;
    transition: all 0.2s ease;
    font-weight: 400;
    resize: none;
    min-height: 56px;
    max-height: 120px;
}

#prompt:focus {
    border-color: #10A85C;
    box-shadow: 0 0 0 2px rgba(16, 168, 92, 0.1);
}

/* ========== BOUTONS EN CERCLE PROFESSIONNELS ========== */
.icon-button { 
    background: #10A85C; 
    color: white; 
    border: none; 
    width: 44px; 
    height: 44px; 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    font-size: 16px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    font-weight: 500;
    align-self: flex-end;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(16, 168, 92, 0.25);
    position: relative;
    overflow: hidden;
}

.icon-button:hover {
    background: #0d8c4d;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(16, 168, 92, 0.35);
}

.icon-button:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.icon-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.icon-button:active::after {
    width: 100%;
    height: 100%;
}

/* Bouton microphone */
.mic-button { 
    background: #6b7280;
}

.mic-button:hover {
    background: #575c67;
}

.mic-button.recording { 
    background: #dc2626; 
    animation: recording-pulse 1.2s ease-in-out infinite; 
}

@keyframes recording-pulse { 
    0% { 
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
        transform: scale(1);
    } 
    50% { 
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0.2);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
        transform: scale(1);
    } 
}

/* Bouton stop */
.stop-button { 
    background: #dc2626 !important; 
    animation: stop-pulse 1.5s ease-in-out infinite; 
}

@keyframes stop-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.6);
    }
}

/* Styles pour l'historique */
.conv-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
    flex-shrink: 0;
    font-weight: 500;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.user-name {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.conversation.active .user-name {
    color: rgba(0, 0, 0, 0.7);
}

.conversation.active .user-avatar {
    color: #10A85C;
}

/* Section utilisateur en bas style DeepSeek */
.user-section-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-top: auto;
    border-top: 1px solid #e8eaed;
    background: transparent;
}

.user-info-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* AVATAR USER EN CERCLE */
.user-avatar-bottom {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8eaed;
    background: transparent;
    transition: all 0.2s ease;
}

.user-avatar-bottom:hover {
    border-color: #10A85C;
    transform: scale(1.05);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.username-bottom {
    font-size: 14px;
    font-weight: 500;
    color: #1f1f1f;
}

.user-status {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.logout-btn-bottom {
    background: transparent;
    border: 1px solid #e0e6ed;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.logout-btn-bottom:hover {
    background: #f0fdf4;
    border-color: #10A85C;
    color: #10A85C;
}

/* Styles pour le formatage des messages */
.message.assistant .bubble p {
    margin-bottom: 1em;
    line-height: 1.6;
    text-align: left;
    white-space: normal;
}

.message.assistant .bubble ul {
    margin: 1em 0;
    padding-left: 1.5em;
}

.message.assistant .bubble li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar h2, .conv-info, .user-name {
        display: none;
    }
    
    .new-chat-btn span {
        display: none;
    }
    
    .new-chat-btn i {
        margin-right: 0;
    }
    
    .bubble {
        max-width: 90%;
        font-size: 14px;
    }
    
    .welcome {
        font-size: 18px;
        margin-top: 80px;
        padding: 0 20px;
    }
    
    .user-details {
        display: none;
    }
}

/* Supprimer tous les fonds verts des avatars */
img.avatar,
img.user-avatar-bottom,
.user-avatar i {
    background: transparent !important;
    background-color: transparent !important;
}

.message .avatar {
    background: transparent !important;
}

.conversation .user-avatar {
    background: transparent !important;
}

.conversation.active .user-avatar {
    background: rgba(16, 168, 92, 0.1) !important;
}

/* Supprimer tout style carré */
.user-info-bottom img {
    border-radius: 50% !important;
}
/* Styles pour les actions de conversation */
.conv-actions {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.conv-menu-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.conversation.active .conv-menu-btn {
    opacity: 1;
}

.conv-menu-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #374151;
}

.conv-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
    margin-top: 4px;
}

.conv-menu.show {
    display: block;
}

.conv-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
}

.conv-menu-item:hover {
    background: #fef2f2;
}

.conv-menu-item i {
    font-size: 12px;
    width: 14px;
    text-align: center;
}

.conv-date {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    font-weight: 400;
}

/* Hover sur la conversation pour montrer le bouton menu */
.conversation:hover .conv-menu-btn {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .conv-menu-btn {
        opacity: 1 !important;
    }
    
    .conv-menu {
        right: -10px;
        min-width: 130px;
    }
}