/* Task History Shortcode Styles */
.helpme-task-history-container {
    max-width: 100%;
    margin: 20px 0;
}

/* Filters Section */
.helpme-task-filters {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
}

.helpme-search-container {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.helpme-search-container input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.helpme-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.helpme-filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.helpme-filter-item-clear-filter{
    align-self: flex-end;
}

.helpme-filter-item label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.helpme-filter-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

/* Buttons */
.helpme-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.helpme-btn-primary {
    background-color: #0073aa;
    color: white;
}

.helpme-btn-primary:hover {
    background-color: #005a87;
}

.helpme-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.helpme-btn-secondary:hover {
    background-color: #e0e0e0;
}

/* Table Styles */
.helpme-table-wrapper {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.helpme-task-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.helpme-task-history-table th,
.helpme-task-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.helpme-task-history-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.helpme-task-history-table th.no-sort {
    cursor: default;
}

.helpme-task-history-table th.sortable:hover {
    background-color: #e9ecef;
}

.helpme-sort-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.helpme-sort-indicator:before {
    content: "↕";
    font-size: 12px;
}

.helpme-task-history-table th.sort-asc .helpme-sort-indicator:before {
    content: "↑";
    opacity: 1;
}

.helpme-task-history-table th.sort-desc .helpme-sort-indicator:before {
    content: "↓";
    opacity: 1;
}

.helpme-task-history-table tbody tr:hover {
    background-color: #f8f9fa;
}

.helpme-task-history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Field-specific styles */
.helpme-field-task a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.helpme-field-task a:hover {
    text-decoration: underline;
}

.helpme-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.helpme-status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.helpme-status-in-progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

.helpme-status-completed {
    background-color: #d4edda;
    color: #155724;
}

.helpme-status-overdue {
    background-color: #f8d7da;
    color: #721c24;
}

.helpme-priority {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.helpme-priority-low {
    background-color: #e2e3e5;
    color: #383d41;
}

.helpme-priority-medium,
.helpme-priority-normal {
    background-color: #fff3cd;
    color: #856404;
}

.helpme-priority-high {
    background-color: #f8d7da;
    color: #721c24;
}

/* Progress Bar */
.helpme-progress-bar {
    position: relative;
    width: 100px;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.helpme-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.helpme-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* No Tasks Message */
.helpme-no-tasks {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Pagination */
.helpme-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.helpme-page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.helpme-page-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.helpme-page-btn.active {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.helpme-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.helpme-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.helpme-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: helpme-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes helpme-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .helpme-search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .helpme-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .helpme-filter-item {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .helpme-filter-item label {
        min-width: 80px;
        margin-bottom: 0;
    }
    
    .helpme-filter-select {
        flex: 1;
        min-width: auto;
    }
    
    .helpme-task-history-table {
        font-size: 12px;
    }
    
    .helpme-task-history-table th,
    .helpme-task-history-table td {
        padding: 8px;
    }
    
    .helpme-progress-bar {
        width: 80px;
        height: 16px;
    }
    
    .helpme-progress-text {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .helpme-task-filters {
        padding: 15px;
    }
    
    .helpme-task-history-table {
        font-size: 11px;
    }
    
    .helpme-task-history-table th,
    .helpme-task-history-table td {
        padding: 6px;
    }
    
    .helpme-status,
    .helpme-priority {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .helpme-progress-bar {
        width: 60px;
        height: 14px;
    }
    
    .helpme-pagination {
        gap: 2px;
    }
    
    .helpme-page-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}
