﻿.customer-tasks-page {
    padding: 20px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

    .section-header h2 {
        margin: 0;
        color: #333;
        font-size: 1.5rem;
    }

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0 0 0;
}

.section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Task Grid Layouts */
.tasks-grid, .history-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.tasks-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.history-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

/* Task Cards */
.task-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

    .task-card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        transform: translateY(-2px);
    }

.task-card-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.task-status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
}

    .task-status-indicator.can-run {
        background: #d4edda;
        color: #155724;
    }

    .task-status-indicator.cannot-run {
        background: #fff3cd;
        color: #856404;
    }

.task-card-body {
    padding: 20px;
}

.task-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.task-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

    .status-badge.status-pending {
        background: #fff3cd;
        color: #856404;
    }

    .status-badge.status-running {
        background: #cce5ff;
        color: #004085;
    }

    .status-badge.status-completed {
        background: #d4edda;
        color: #155724;
    }

    .status-badge.status-failed {
        background: #f8d7da;
        color: #721c24;
    }

    .status-badge.status-cancelled {
        background: #e2e3e5;
        color: #383d41;
    }

/* Task Details */
.task-details {
    margin-bottom: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.detail-label {
    font-weight: 500;
    color: #666;
}

.detail-value {
    color: #333;
}

/* Error Details */
.error-details {
    margin-top: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    background: #f8d7da;
}

.error-header {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #721c24;
    cursor: pointer;
}

.error-content {
    padding: 15px;
    border-top: 1px solid #f5c6cb;
    background: #fff;
}

    .error-content pre {
        margin: 0;
        white-space: pre-wrap;
        word-wrap: break-word;
        font-size: 0.85rem;
        color: #721c24;
    }

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

    .loading-spinner i {
        font-size: 2rem;
        color: #007bff;
        margin-bottom: 10px;
    }

/* No Data States */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

    .no-data i {
        font-size: 3rem;
        margin-bottom: 15px;
        color: #ccc;
    }

/* Alert Container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tasks-grid, .history-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-actions {
        width: 100%;
        justify-content: space-between;
    }

    .task-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .task-card-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Animation for status changes */
.task-card.status-updating {
    opacity: 0.7;
    transform: scale(0.98);
}

.task-card.status-updated {
    animation: statusUpdate 0.5s ease;
}

@keyframes statusUpdate {
    0% {
        background-color: #e3f2fd;
    }

    100% {
        background-color: #fff;
    }
}
