/* Tasks page styles */

/* Container */
.tasks-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

/* Header */
.tasks-header {
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tasks-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2rem;
    color: #f1f5f9;
}

.tasks-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    font-size: 1.5rem;
}

.header-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Add Task Section */
.add-task-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.add-task-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.task-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #475569;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 1rem;
    transition: all 0.2s;
}

.task-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.task-category-select,
.task-date-input {
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #475569;
    border-radius: 8px;
    color: #f1f5f9;
    transition: all 0.2s;
}

.task-category-select:focus,
.task-date-input:focus {
    outline: none;
    border-color: #667eea;
}

.button-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.plus-icon {
    font-size: 1.25rem;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #1e293b;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.filter-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: rgba(100, 116, 139, 0.1);
    color: #cbd5e1;
}

.filter-tab.active {
    background: #334155;
    color: #f1f5f9;
}

.priority-tab.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #0f172a;
}

.tab-icon {
    font-size: 1.125rem;
}

.tab-count {
    padding: 0.125rem 0.5rem;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-tab.active .tab-count {
    background: rgba(241, 245, 249, 0.2);
}

/* Task List */
.task-list-container {
    min-height: 300px;
    margin-bottom: 2rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #1e293b;
    border-radius: 12px;
    transition: all 0.2s;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item:hover {
    background: #334155;
    transform: translateX(4px);
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #64748b;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.task-checkbox:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-text {
    color: #f1f5f9;
    font-size: 1rem;
}

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

.task-category {
    padding: 0.25rem 0.75rem;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 999px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.task-due-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.task-due-date.overdue {
    color: #ef4444;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(100, 116, 139, 0.1);
    color: #cbd5e1;
}

.priority-btn.active {
    color: #fbbf24;
}

.edit-btn:hover {
    color: #3b82f6;
}

.delete-btn:hover {
    color: #ef4444;
}

/* Task input for editing */
.task-edit-input {
    flex: 1;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #475569;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 1rem;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state svg {
    color: #475569;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
}

/* Loading state */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: #64748b;
}

/* Footer */
.tasks-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #1e293b;
    border-radius: 12px;
}

.footer-info {
    color: #94a3b8;
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

.button-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}

.button-secondary:hover {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

/* Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #334155;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

/* HTMX loading states */
.htmx-request .task-item {
    opacity: 0.6;
}

.htmx-request.filter-tab {
    pointer-events: none;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 640px) {
    .tasks-container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-stats {
        width: 100%;
        justify-content: space-around;
    }

    .add-task-form {
        flex-direction: column;
    }

    .task-input {
        width: 100%;
    }

    .filter-tabs {
        flex-wrap: wrap;
    }

    .tasks-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
