/* Task Manager UI — Minimalist Dark Theme */
:root {
    --bg: #0d1117;
    --card: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --gold: #d4af37;
    --done-bg: #0d2818;
    --done-text: #7ee787;
    --danger: #f85149;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}
.container { max-width: 800px; margin: 0 auto; padding: 20px; }

/* Header */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px;
    flex-wrap: wrap; gap: 12px;
}
h1 { font-size: 24px; font-weight: 700; }
.filter-group { display: flex; gap: 4px; }
.filter-btn {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--muted); text-decoration: none; font-size: 13px; transition: all .15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--text); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Add Form */
.add-form {
    display: flex; gap: 8px; margin-bottom: 20px;
}
.add-form input[type="text"] {
    flex: 1; padding: 10px 14px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 14px; outline: none;
}
.add-form input[type="text"]:focus { border-color: var(--accent); }
.add-form input[name="category"] { flex: 0 0 140px; }

/* Кастомный выбор категории (кнопки) */
.cat-select {
    display: flex; gap: 4px; flex-shrink: 0;
}
.cat-opt {
    width: 40px; height: 40px; border: 2px solid var(--border);
    background: var(--card); border-radius: var(--radius);
    font-size: 18px; cursor: pointer; transition: all .15s;
    display: flex; align-items: center; justify-content: center;
}
.cat-opt:hover { border-color: var(--muted); }
.cat-opt.active {
    border-color: var(--accent); background: rgba(88,166,255,0.15);
    box-shadow: 0 0 8px rgba(88,166,255,0.3);
}
.add-btn:disabled {
    opacity: 0.3; cursor: not-allowed;
}
.add-btn {
    padding: 10px 18px; background: var(--accent); color: #fff; border: none;
    border-radius: var(--radius); font-size: 20px; cursor: pointer; transition: opacity .15s;
}
.add-btn:hover { opacity: .85; }

/* Task List */
.task-list { display: flex; flex-direction: column; gap: 6px; }
.task-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); transition: all .15s;
}
.task-item:hover { border-color: var(--muted); }
.task-item.done { background: var(--done-bg); border-color: #1a3a2a; }
.task-item.done .task-text { text-decoration: line-through; color: var(--done-text); }

.toggle-btn {
    background: none; border: none; font-size: 20px; cursor: pointer; padding: 2px;
    line-height: 1; filter: grayscale(0.3);
}
.toggle-btn:hover { filter: grayscale(0); }

.task-content { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-text { font-size: 14px; line-height: 1.4; word-break: break-word; }

.category-badge {
    font-size: 11px; padding: 2px 8px; background: rgba(88, 166, 255, 0.15);
    color: var(--accent); border-radius: 12px; white-space: nowrap;
}

.task-actions { display: flex; gap: 4px; }
.edit-btn, .delete-btn {
    background: none; border: none; font-size: 16px; cursor: pointer;
    padding: 4px; border-radius: 4px; opacity: 0.4; transition: all .15s;
}
.task-item:hover .edit-btn, .task-item:hover .delete-btn { opacity: 0.7; }
.edit-btn:hover, .delete-btn:hover { opacity: 1 !important; }

/* Footer */
.footer-info {
    text-align: center; padding: 24px; color: var(--muted); font-size: 13px;
}

/* Modal */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-content {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 24px; max-width: 500px; width: 90%; position: relative;
}
.modal-content h2 { margin-bottom: 16px; font-size: 18px; }
.close-modal {
    position: absolute; top: 12px; right: 16px; font-size: 24px;
    cursor: pointer; color: var(--muted);
}
.close-modal:hover { color: var(--text); }

/* Responsive / Mobile Friendly */
@media (max-width: 600px) {
    .container { padding: 10px; }
    
    header { padding: 14px 0; margin-bottom: 16px; }
    h1 { font-size: 18px; }
    
    .filter-btn {
        padding: 8px 16px; font-size: 14px; flex: 1; text-align: center;
    }
    .filter-group { width: 100%; }
    
    .add-form {
        flex-direction: column; gap: 8px;
    }
    .add-form input[type="text"] {
        padding: 14px; font-size: 16px;
    }
    
    .cat-select {
        width: 100%; gap: 6px;
    }
    .cat-opt {
        flex: 1; height: 48px; font-size: 22px;
    }
    
    .add-btn {
        width: 100%; padding: 14px; font-size: 22px;
    }
    
    .task-item {
        padding: 14px 12px; gap: 10px;
    }
    
    .toggle-btn {
        font-size: 24px; padding: 4px;
    }
    
    .task-text {
        font-size: 15px; line-height: 1.5;
    }
    
    .edit-btn, .delete-btn {
        font-size: 20px; padding: 6px; opacity: 0.6;
    }
    
    .category-badge {
        font-size: 12px; padding: 3px 10px;
    }
    
    .footer-info {
        padding: 16px; font-size: 14px;
    }
}
