@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-base: #09090b;
    --bg-panel: #141417;
    --bg-input: #1c1c21;
    --accent-red: #ef4444;
    --accent-hover: #dc2626;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #27272a;
    
    --sidebar-width: 260px;
    --collapsed-width: 80px;
}

body, html {
    margin: 0; padding: 0; height: 100%;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    overflow: hidden;
}

.container { display: flex; height: 100%; }

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex; flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    box-sizing: border-box;
}

.sidebar.collapsed { width: var(--collapsed-width); padding: 24px 8px; }

.sidebar-header {
    margin-bottom: 32px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center;
}

.sidebar-logo {
    width: 110px; height: 110px; 
    border-radius: 50%;
    transition: all 0.3s ease;
}
.sidebar.collapsed .sidebar-logo { width: 60px; height: 60px; }

.sidebar-brand {
    font-size: 1.25rem; font-weight: 700; color: var(--text-main);
    transition: opacity 0.3s ease;
}
.sidebar-brand span { color: var(--accent-red); }
.sidebar.collapsed .sidebar-brand { opacity: 0; pointer-events: none; display: none; }

.menu-item {
    cursor: pointer; padding: 12px; margin-bottom: 8px;
    border-radius: 8px; color: var(--text-muted);
    font-weight: 500; transition: all 0.2s ease;
    display: flex; align-items: center; gap: 12px;
}
.menu-item:hover, .menu-item.active {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.sidebar.collapsed .menu-item { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .menu-item .menu-text { display: none; }

#collapseBtn {
    margin-top: auto; padding: 10px;
    background-color: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-muted);
    cursor: pointer; transition: all 0.2s ease;
    display: flex; align-items: center; justify-content: center;
}
#collapseBtn:hover { border-color: var(--accent-red); color: var(--accent-red); }

.main-content { flex-grow: 1; padding: 40px; overflow-y: auto; }

h1, h2, h3 { color: var(--text-main); font-weight: 600; margin-top: 0; }
h1 { font-size: 1.75rem; margin-bottom: 24px; border-bottom: 1px solid var(--border-color); padding-bottom: 16px; }
h3 { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }

hr { border: none; border-top: 1px solid var(--border-color); margin: 32px 0; }

label { display: block; margin-bottom: 8px; color: var(--text-muted); font-weight: 500; font-size: 0.9rem; }

input, select, textarea {
    width: 100%; background-color: var(--bg-input); color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 6px;
    padding: 12px; margin-bottom: 20px; font-family: 'Inter', sans-serif;
    box-sizing: border-box; transition: border-color 0.2s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-red); }
textarea { resize: vertical; min-height: 80px; }

button {
    background-color: var(--accent-red); color: white;
    border: none; border-radius: 6px; padding: 12px 24px;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    font-family: 'Inter', sans-serif; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:hover { background-color: var(--accent-hover); box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }

.btn-secondary { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background-color: var(--bg-input); border-color: var(--text-muted); box-shadow: none; }

.btn-outline-red { background-color: transparent; border: 1px solid var(--accent-red); color: var(--accent-red); }
.btn-outline-red:hover { background-color: rgba(239, 68, 68, 0.1); }

ul { list-style-type: none; padding: 0; margin: 0; }
#projectList .menu-item, #fileList .menu-item {
    background-color: var(--bg-panel); border: 1px solid var(--border-color);
    margin-bottom: 8px;
}
#projectList .menu-item:hover, #fileList .menu-item:hover {
    border-color: var(--accent-red); transform: translateX(4px);
}

.task-card {
    background-color: var(--bg-panel); border: 1px solid var(--border-color); border-left: 4px solid var(--accent-red);
    padding: 16px; margin-bottom: 16px; border-radius: 6px;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
    z-index: 1000; display: flex; justify-content: center; align-items: center;
}
.modal-box {
    background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px;
    padding: 32px; min-width: 350px; max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); text-align: center;
}
.modal-box h3 { color: var(--text-main); border-bottom: none; margin-bottom: 12px; padding: 0; font-size: 1.25rem; }
.modal-box p { color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 12px; margin-top: 0; }

.hidden { display: none !important; }

/* NOUVEAU : ANIMATION DE CHARGEMENT IA */
.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-red);
    border-radius: 50%;
    width: 40px; height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }