/* web_app/static/css/tasks.css */

/* Фильтры */
.tasks-filters {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 4px;
    background: white;
    border-radius: 8px;
    padding: 2px;
    border: 1px solid #e0e0e0;
}

.filter-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f0f2f5;
}

.filter-btn.active {
    background: #667eea;
    color: white;
}

.task-search {
    flex: 1;
    min-width: 100px;
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 12px;
    outline: none;
}

.task-search:focus {
    border-color: #667eea;
}

/* Сетка задач */
.tasks-grid {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #667eea;
    transition: all 0.2s ease;
}

.task-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.task-card.completed {
    opacity: 0.6;
    border-left-color: #2ecc71;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.task-priority {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.task-priority.high {
    background: #ffe5e5;
    color: #d63031;
}

.task-priority.medium {
    background: #fff3cd;
    color: #f39c12;
}

.task-priority.low {
    background: #e8f5e9;
    color: #27ae60;
}

.task-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 15px;
    margin-bottom: 6px;
}

.task-creator, .task-assignee {
    font-size: 13px;
    color: #667eea;
    margin-bottom: 4px;
}

.task-description {
    font-size: 14px;
    color: #555;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.task-actions button {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-complete {
    background: #2ecc71;
    color: white;
}

.btn-complete:hover {
    background: #27ae60;
}

.btn-delete {
    background: #ff4757;
    color: white;
}

.btn-delete:hover {
    background: #e84118;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-text {
    font-size: 18px;
    font-weight: 500;
    color: #666;
}

.empty-sub {
    font-size: 14px;
    margin-top: 4px;
}

/* Спиннер загрузки */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 16px;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #ff4757;
    font-size: 16px;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #ff4444;
    color: white;
    border-color: #ff4444;
}

.btn-delete-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
}

.btn-delete-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.task-card {
    position: relative;
}

.task-result {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 8px;
    font-size: 13px;
    color: #2e7d32;
}

.task-completed-badge {
    margin-top: 8px;
    padding: 4px 10px;
    background: #c8e6c9;
    border-radius: 12px;
    font-size: 12px;
    color: #1b5e20;
    display: inline-block;
}

.task-cancelled-badge {
    margin-top: 8px;
    padding: 4px 10px;
    background: #ffebee;
    border-radius: 12px;
    font-size: 12px;
    color: #c62828;
    display: inline-block;
}

/* Тёмная тема для задач */
[data-theme="dark"] .task-card {
    background: var(--surface-card);
    border-left-color: var(--primary);
}

[data-theme="dark"] .task-title {
    color: var(--text);
}

[data-theme="dark"] .task-meta {
    color: var(--text-secondary);
}

[data-theme="dark"] .task-description {
    background: var(--bg);
    color: var(--text-secondary);
}

[data-theme="dark"] .tasks-filters {
    background: var(--bg);
    border-color: var(--border);
}

[data-theme="dark"] .filter-group {
    background: var(--surface-card);
    border-color: var(--border);
}

[data-theme="dark"] .filter-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .filter-btn.active {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .task-search {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}