:root {
    --bg-dark: #0f111a;
    --card-bg: #1e212b;
    --modal-bg: #161822;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: rgba(255,255,255,0.08);

    --col-todo: #8b5cf6;
    --col-doing: #3b82f6;
    --col-done: #10b981;
    --accent: #6366f1;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }

body { background-color: var(--bg-dark); color: var(--text-main); height: 100vh; overflow: hidden; }

/* Background */
.grid-bg {
    position: fixed; inset: 0; z-index: -1;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
}

.app-container { display: flex; flex-direction: column; height: 100%; padding: 20px; max-width: 1800px; margin: 0 auto; }

/* HEADER */
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; height: 60px; flex-shrink: 0; }
.brand { display: flex; gap: 15px; align-items: center; }
.logo-box {
    width: 40px; height: 40px; background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: white;
}
.brand h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 2px; }
.badge-pro { font-size: 0.6rem; background: var(--accent); padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.subtitle { font-size: 0.8rem; color: var(--text-muted); }

.header-controls { display: flex; align-items: center; gap: 15px; flex: 1; justify-content: flex-end; }

/* SEARCH & TRASH */
.search-wrapper {
    background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 8px 15px; border-radius: 8px; display: flex; align-items: center; gap: 10px; width: 250px;
    transition: 0.3s;
}
.search-wrapper input { background: transparent; border: none; color: white; outline: none; width: 100%; padding: 0; }
.search-wrapper i { color: var(--text-muted); }

/* La zone poubelle est cachée par défaut */
.trash-zone {
    opacity: 0; /* Invisible */
    pointer-events: none; /* On ne peut pas cliquer dessus */
    transform: translateY(-10px); /* Un peu plus haut */
}

/* Quand le JS ajoute cette classe : */
.trash-zone.visible {
    opacity: 1; /* Devient visible */
    pointer-events: all; /* Devient interactive */
    transform: translateY(0); /* Descend à sa place */
}
.trash-zone.drag-over { background: var(--danger); color: white; transform: scale(1.05); }

.btn-icon { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: var(--text-muted); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.btn-icon:hover { color: white; background: rgba(255,255,255,0.1); }

/* BOARD KANBAN */
.kanban-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; flex: 1; min-height: 0; overflow-x: auto; }
.column { background: #13151d; border-radius: 12px; border: 1px solid var(--border-color); display: flex; flex-direction: column; height: 100%; min-width: 280px; }

.column-header { padding: 15px; border-top: 3px solid; border-radius: 12px 12px 0 0; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02); flex-shrink: 0; }
.col-title { display: flex; align-items: center; gap: 8px; }
.col-title h2 { font-size: 0.95rem; font-weight: 600; }
.count { background: rgba(255,255,255,0.1); padding: 1px 8px; border-radius: 10px; font-size: 0.7rem; color: var(--text-muted); }
.add-task-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; transition: 0.2s; font-size: 1.1rem; }
.add-task-btn:hover { color: white; transform: scale(1.2); }

/* LISTE & CARTES */
.task-list { padding: 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.task-list.drag-over { background: rgba(255,255,255,0.03); }
.task-list::-webkit-scrollbar { width: 5px; }
.task-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.task-card {
    background: var(--card-bg); padding: 12px; border-radius: 8px;
    border: 1px solid var(--border-color); cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: all 0.2s;
    position: relative; display: flex; flex-direction: column; gap: 8px; user-select: none;
}
.task-card:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.task-card.dragging { opacity: 0.4; border: 1px dashed var(--text-muted); }

.card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.priority-tag { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
.priority-low { color: #94a3b8; background: rgba(148, 163, 184, 0.1); }
.priority-medium { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.priority-high { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.assignee-badge {
    display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08); padding: 3px 8px; border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1); max-width: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.assignee-badge i { color: var(--accent); font-size: 0.8rem; }

.task-title { font-size: 0.9rem; font-weight: 500; line-height: 1.4; color: #f1f5f9; }
.task-desc { font-size: 0.75rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.05); }
.date-badge { font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.date-badge.overdue { color: var(--danger); font-weight: 600; }

/* MODALES */
.modal-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); 
    display: flex; justify-content: center; align-items: center; z-index: 9999;
    opacity: 0; pointer-events: none; transition: 0.3s; 
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.glass-modal { 
    background: var(--modal-bg); border: 1px solid var(--border-color); width: 90%; max-width: 450px; 
    border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); display: flex; flex-direction: column; 
    transform: scale(0.9); transition: 0.3s;
}
.modal-overlay.active .glass-modal { transform: scale(1); }

.modal-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1rem; }

form { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
input, select, textarea { background: #0f111a; border: 1px solid #334155; padding: 10px; border-radius: 6px; color: white; outline: none; font-size: 0.9rem; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }

.modal-footer { padding-top: 10px; display: flex; gap: 10px; }
.spacer { flex: 1; }
.btn-primary { background: var(--accent); color: white; border: none; padding: 8px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-ghost { background: transparent; border: 1px solid #475569; color: var(--text-muted); padding: 8px 20px; border-radius: 6px; cursor: pointer; }
.btn-danger-outline { background: transparent; border: 1px solid var(--danger); color: var(--danger); padding: 8px 16px; border-radius: 6px; cursor: pointer; }

/* MODALE DANGER */
.danger-style { text-align: center; padding: 30px; border-color: rgba(239, 68, 68, 0.3); }
.icon-pulse { font-size: 3rem; color: var(--danger); margin-bottom: 15px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.7; } 100% { transform: scale(1); opacity: 1; } }
.modal-actions-center { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.btn-danger-glow { background: linear-gradient(135deg, #ef4444, #b91c1c); color: white; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); }

.hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .kanban-board { grid-template-columns: 1fr; }
    .column { height: auto; max-height: 500px; }
    header { flex-direction: column; height: auto; gap: 15px; margin-bottom: 20px; }
    .header-controls { width: 100%; justify-content: space-between; }
    .search-wrapper { flex: 1; width: auto; }
}