:root {
    --bg: #0b0d0e;
    --sidebar-bg: rgba(18, 18, 20, 0.95);
    --fg: #e2e8f0;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --glass-border: rgba(255, 255, 255, 0.08);
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 40%);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    overflow: hidden; /* Empêche de bloquer le bouton menu */
}

.sidebar.collapsed {
    width: 0;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none !important; /* Désactive les clics sur la barre fermée */
}

.sidebar-header {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 2.5px;
    color: #64748b;
}

.close-mobile-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #94a3b8;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
}

.projects-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: none;
}

.projects-list::-webkit-scrollbar { display: none; }

.project-item {
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(5px);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.project-item .name {
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-item .cat {
    font-size: 0.6rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.github-link {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117; /* GitHub dark background */
    border: 1px solid var(--glass-border);
    border-radius: 50%; /* Forme circulaire */
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.github-link:hover {
    background: #161b22;
    transform: scale(1.15) rotate(5deg);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.sidebar-footer {
    padding: 24px;
    font-size: 0.7rem;
    color: #334155;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: rgba(0,0,0,0.2);
}

header {
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 30px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(11, 13, 14, 0.5);
    backdrop-filter: blur(10px);
}

.menu-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #94a3b8;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.header-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-info .subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    overflow: hidden;
}

.chat-window {
    width: 100%;
    max-width: 900px;
    background: rgba(18, 18, 20, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

#chat-messages::-webkit-scrollbar { width: 6px; }
#chat-messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: fadeInUp 0.5s ease-out;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}


.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center !important; /* Force l'affichage du haut de l'image */
}

.bubble {
    padding: 14px 22px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 1rem;
}

.user .bubble {
    background: var(--accent);
    color: white;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.bot .bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: #e2e8f0;
    border-top-left-radius: 4px;
}

.input-area {
    padding: 24px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
}

#chat-form {
    display: flex;
    gap: 15px;
}

input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px 24px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

#send-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 14px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

#send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

footer {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.footer-links a:hover { color: white; }

/* Mobile View Styles */
@media (max-width: 800px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 2000;
        width: 300px;
        transform: translateX(-100%);
        opacity: 1;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .close-mobile-btn { display: flex; }
    
    header { padding: 15px 25px; gap: 20px; }
    .header-info h1 { font-size: 1.3rem; }
    .header-info .subtitle { font-size: 0.75rem; }
    
    .chat-section { padding: 10px; }
    .chat-window { border-radius: 20px; }
    
    #chat-messages { padding: 15px; gap: 15px; }
    .bubble { padding: 10px 16px; font-size: 0.9rem; }
    .avatar { width: 32px; height: 32px; }
    
    .input-area { padding: 15px; }
    #chat-form { gap: 8px; }
    input { padding: 12px 16px; font-size: 0.9rem; }
    #send-btn { width: 48px; height: 48px; }
    
    .footer-links { gap: 20px; }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1500;
    display: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.overlay.visible {
    display: block;
    opacity: 1;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
