/* =====================================================
   AUFGABEN-SYSTEM
   Erstellen, Löschen, Erledigen, Suchen, Sortieren
   ===================================================== */

/* Aufgaben Toolbar */
.tasks-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.tasks-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}

.tasks-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
}

.tasks-filters select:hover {
    border-color: #3b82f6;
}

.tasks-filters select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Suche */
.tasks-search {
    position: relative;
    flex: 0 0 300px;
}

.tasks-search input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tasks-search input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tasks-search i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

/* Statistik */
.tasks-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tasks-stats span {
    color: #64748b;
    font-weight: 500;
}

/* Aufgaben-Liste */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Aufgaben-Karte */
.task-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.task-card.completed {
    background: #f8fafc;
    opacity: 0.8;
}

.task-card.overdue {
    border-left: 4px solid #ef4444;
}

/* Checkbox */
.task-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 0.25rem;
}

/* Inhalt */
.task-content {
    min-width: 0;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.task-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.task-title.line-through {
    text-decoration: line-through;
    color: #94a3b8;
}

.task-description {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
}

.task-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.task-meta i {
    opacity: 0.7;
}

.task-due.overdue-text {
    color: #ef4444;
    font-weight: 600;
}

/* Priorität */
.task-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.task-priority.priority-niedrig {
    background: #dbeafe;
    color: #1e40af;
}

.task-priority.priority-normal {
    background: #e0e7ff;
    color: #4338ca;
}

.task-priority.priority-hoch {
    background: #fed7aa;
    color: #c2410c;
}

.task-priority.priority-dringend {
    background: #fecaca;
    color: #991b1b;
}

/* Aktionen */
.task-actions {
    display: flex;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-card:hover .task-actions {
    opacity: 1;
}

/* Badge im Menü */
.badge-tasks {
    display: none;
    margin-left: auto;
    background: #f59e0b;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .tasks-search {
        flex: 1 1 auto;
    }
}

@media (max-width: 768px) {
    .tasks-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tasks-filters {
        flex-direction: column;
    }
    
    .tasks-filters select {
        width: 100%;
    }
    
    .tasks-search {
        flex: 1 1 auto;
    }
    
    .tasks-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-card {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
    }
    
    .task-actions {
        opacity: 1; /* Immer sichtbar auf Mobile */
        grid-column: 2;
        justify-self: end;
    }
    
    .task-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-priority {
        align-self: flex-start;
    }
    
    .task-meta {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .task-card {
        padding: 0.75rem;
    }
    
    .task-title {
        font-size: 0.95rem;
    }
    
    .task-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Animationen */
@keyframes taskFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card {
    animation: taskFadeIn 0.3s ease;
}

/* Hover-Effekt für Checkbox */
.task-checkbox input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.task-checkbox input[type="checkbox"]:checked {
    accent-color: #10b981;
}
