/* Task Follow-Up Plugin Styles */

/* Common styles */
.tfu-form-group {
    margin-bottom: 1.5rem;
}

.tfu-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.tfu-field-description {
    display: block;
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    margin-bottom: 0.75rem;
    margin-top: 0.25rem;
    line-height: 1.4;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid #007cba;
    border-radius: 0 4px 4px 0;
    font-weight: 500;
}

.tfu-form-group input[type="text"],
.tfu-form-group input[type="date"],
.tfu-form-group input[type="time"],
.tfu-form-group select,
.tfu-form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.tfu-form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* Add Task Form */
.tfu-add-task-form {
    max-width: 95%;
    width: 100%;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tfu-add-task-form h2 {
    margin-bottom: 2rem;
    color: #333;
}

/* Edit Task Tabs */
.tfu-edit-tabs {
    margin-top: 1rem;
    width: 100%;
}

.tfu-edit-tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    border-bottom: 2px solid #eee;
}

.tfu-edit-tab {
    margin-right: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    font-weight: 500;
}

.tfu-edit-tab:hover {
    background: #e9ecef;
}

.tfu-edit-tab.active {
    background: #fff;
    border-color: #3498db;
    color: #3498db;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}

.tfu-edit-tab span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tfu-edit-tab-content {
    padding: 1.5rem 0;
    width: 100%;
}

/* Task Instances Table */
.tfu-instances-table-wrapper {
    margin-top: 1rem;
    width: 100%;
    overflow-x: auto;
}

.tfu-instances-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tfu-instances-table th,
.tfu-instances-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tfu-instances-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tfu-instances-table td {
    text-align: center;
    vertical-align: middle;
}

/* Alternating row backgrounds for better readability */
.tfu-instances-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.tfu-instances-table tbody tr:nth-child(odd) {
    background: #fff;
}

.tfu-instances-table tbody tr:hover {
    background: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

/* Right-align date/time columns for better readability */
.tfu-instances-table td:nth-child(2),
.tfu-instances-table td:nth-child(3),
.tfu-instances-table td:nth-child(7) {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Center-align status and late indicators */
.tfu-instances-table td:nth-child(5),
.tfu-instances-table td:nth-child(6) {
    text-align: center;
}

.tfu-loading-message {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
    font-size: 1.1rem;
}

.tfu-no-instances {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-style: italic;
    font-size: 1.1rem;
}

.tfu-late-indicator {
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.875rem;
    display: inline-block;
    min-width: 40px;
}

.tfu-late-indicator.late {
    background: #ffebee;
    color: #c62828;
}

.tfu-late-indicator.on-time {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Consistent status badge sizing */
.tfu-instances-table .tfu-status {
    padding: 0.3rem 0.8rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 80px;
    display: inline-block;
}

/* All Tasks Page */
.tfu-all-tasks {
    margin: 2rem 0;
}

.tfu-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.tfu-filters {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid #e0e0e0;
}

#tfu-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.tfu-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    flex: 1;
}

.tfu-filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.tfu-filter-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-height: 42px;
}

.tfu-filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    margin-top: 0.5rem;
}

.tfu-filter-actions button {
    padding: 0.75rem 1.5rem;
    min-height: 42px;
    white-space: nowrap;
}

/* Tasks Table */
.tfu-tasks-table-wrapper {
    overflow-x: hidden; /* Hide horizontal scroll */
    width: 100%;
    max-width: 100%;
}

.tfu-tasks-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: fixed; /* Fixed layout for better control */
}

.tfu-tasks-table th,
.tfu-tasks-table td {
    padding: 0.75rem 0.5rem; /* Reduced horizontal padding */
    border-bottom: 1px solid #eee;
    text-align: center; /* Center align by default */
    vertical-align: middle; /* Ensure all cells are vertically centered */
    min-height: 3.5rem; /* Consistent row height */
    word-wrap: break-word; /* Allow text to wrap */
    white-space: normal; /* Allow text wrapping */
    overflow: hidden; /* Hide overflow text */
}

/* Column width distribution */
.tfu-tasks-table th:nth-child(1), /* Title */
.tfu-tasks-table td:nth-child(1) {
    width: 15%; /* Reduced from 20% */
    text-align: left;
}

.tfu-tasks-table th:nth-child(2), /* Type */
.tfu-tasks-table td:nth-child(2) {
    width: 10%; /* Reduced from 12% */
}

.tfu-tasks-table th:nth-child(3), /* Dates */
.tfu-tasks-table td:nth-child(3) {
    width: 22%; /* Increased from 20% */
}

.tfu-tasks-table th:nth-child(4), /* Assigned To */
.tfu-tasks-table td:nth-child(4) {
    width: 15%;
}

.tfu-tasks-table th:nth-child(5), /* Task Status */
.tfu-tasks-table td:nth-child(5) {
    width: 13%;
}

.tfu-tasks-table th:nth-child(6), /* Latest Instance Status */
.tfu-tasks-table td:nth-child(6) {
    width: 15%;
}

/* Actions column specific styling */
.tfu-tasks-table th:nth-child(7), /* Actions */
.tfu-tasks-table td:nth-child(7) {
    width: 10%; /* Increased from 5% to 10% */
    text-align: center;
    vertical-align: middle;
}

/* Make the action cell a flex container for perfect centering */
.tfu-tasks-table td:nth-child(7) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem 0.25rem !important; /* Reduced padding */
}

.tfu-tasks-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.tfu-tasks-table tr:hover {
    background: #f9f9f9;
}

.tfu-tasks-table tbody tr {
    height: 4rem; /* Consistent row height */
    border-bottom: 1px solid #eee;
}

/* Remove border from action column specifically */
.tfu-tasks-table tbody tr td:last-child {
    border-bottom: none !important;
}

/* Simplified action buttons container since parent cell handles centering */

/* Status Colors */
.tfu-status {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 100px;
}

.tfu-status-scheduled {
    background: #e3f2fd;
    color: #1976d2;
}

.tfu-status-in-progress {
    background: #fff3e0;
    color: #f57c00;
}

.tfu-status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.tfu-status-cancelled {
    background: #ffebee;
    color: #c62828;
}

/* Action Buttons */
.tfu-action-buttons {
    display: flex !important;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.tfu-tasks-table td.tfu-action-buttons {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0.75rem 0.5rem !important;
    display: table-cell !important;
}

.tfu-action-buttons button {
    width: 32px !important;
    height: 32px !important;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: none !important;
    line-height: 1;
    flex-shrink: 0;
    margin: 0 1px;
}

.tfu-edit-btn {
    background: #2196f3 !important;
    color: white !important;
}

.tfu-edit-btn:hover {
    background: #1976d2 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.tfu-delete-btn {
    background: #f44336 !important;
    color: white !important;
}

.tfu-delete-btn:hover {
    background: #d32f2f !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

.tfu-duplicate-btn {
    background: #ff9800 !important;
    color: white !important;
}

.tfu-duplicate-btn:hover {
    background: #f57c00 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.tfu-duplicate-btn:disabled {
    background: #bbb !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Style all dashicons in action buttons consistently */
.tfu-action-buttons .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
    text-indent: 0; /* Ensure text isn't hidden */
}

/* Ensure dashicons are properly displayed */
.tfu-action-buttons .dashicons:before {
    font-family: dashicons;
    vertical-align: top;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fallback: If dashicons don't load, show emoji */
.tfu-action-buttons .dashicons-edit:not(:before) {
    font-family: inherit;
}

.tfu-action-buttons .dashicons-redo:not(:before) {
    font-family: inherit;
}

.tfu-action-buttons .dashicons-trash:not(:before) {
    font-family: inherit;
}

/* Make sure button contents are centered */
.tfu-action-buttons button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tfu-add-task-form {
        max-width: 98%;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .tfu-instances-table {
        font-size: 0.875rem;
    }
    
    .tfu-instances-table th,
    .tfu-instances-table td {
        padding: 0.5rem;
    }
    
    .tfu-edit-tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .tfu-tasks-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    #tfu-filter-form {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .tfu-filter-group {
        min-width: unset;
        width: 100%;
    }

    .tfu-filter-actions {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #ddd;
    }

    .tfu-filter-actions button {
        flex: 1;
        max-width: 120px;
    }

    /* Adjust table for mobile - maintain percentage layout */
    .tfu-tasks-table {
        font-size: 0.85rem; /* Smaller font on mobile */
    }
    
    .tfu-tasks-table th,
    .tfu-tasks-table td {
        padding: 0.5rem 0.25rem; /* Further reduced padding */
    }
    
    /* Adjust column widths for mobile */
    .tfu-tasks-table th:nth-child(1), /* Title */
    .tfu-tasks-table td:nth-child(1) {
        width: 25%; /* Reduced from 30% */
    }
    
    .tfu-tasks-table th:nth-child(2), /* Type */
    .tfu-tasks-table td:nth-child(2) {
        width: 8%; /* Reduced from 10% */
    }
    
    .tfu-tasks-table th:nth-child(3), /* Dates */
    .tfu-tasks-table td:nth-child(3) {
        width: 27%; /* Increased from 25% */
    }
    
    .tfu-tasks-table th:nth-child(4), /* Assigned To */
    .tfu-tasks-table td:nth-child(4) {
        width: 15%; /* Same */
    }
    
    .tfu-tasks-table th:nth-child(5), /* Task Status */
    .tfu-tasks-table td:nth-child(5) {
        width: 12%; /* Same */
    }
    
    .tfu-tasks-table th:nth-child(6), /* Latest Instance Status */
    .tfu-tasks-table td:nth-child(6) {
        width: 13%; /* Same */
    }
    
    .tfu-tasks-table th:nth-child(7), /* Actions */
    .tfu-tasks-table td:nth-child(7) {
        width: 8%; /* Increased from 5% */
    }
    
    /* Make action buttons even more compact on mobile */
    .tfu-action-buttons {
        gap: 0.1rem; /* Very small gap */
    }
    
    .tfu-action-buttons button {
        width: 28px; /* Slightly smaller on mobile */
        height: 28px;
        font-size: 14px; /* Smaller emoji on mobile */
    }
    
    .tfu-duplicate-btn {
        width: 22px;
        height: 22px;
    }
    
    .tfu-duplicate-btn .dashicons {
        font-size: 12px; /* Smaller icon */
        width: 12px;
        height: 12px;
    }
}

/* Date Range Display */
.tfu-date-range {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tfu-date-range > div {
    text-align: center;
}

/* Latest Instance Status Column */
.tfu-instance-status-cell {
    vertical-align: middle;
    padding: 0.75rem 1rem !important;
}

.tfu-instance-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    max-width: 200px;
    margin: 0 auto;
}

.tfu-instance-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.tfu-instance-badge {
    display: flex;
    justify-content: center;
}

.tfu-instance-badge .tfu-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
    min-width: auto;
}

.tfu-na-text {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

/* Date Time Input Groups */
.tfu-datetime-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.tfu-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tfu-input-group label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
}

.tfu-input-group input[type="date"],
.tfu-input-group input[type="time"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

@media (max-width: 576px) {
    .tfu-datetime-group {
        grid-template-columns: 1fr;
    }
    
    /* Very small screens - hide Type column and redistribute widths */
    .tfu-tasks-table {
        font-size: 0.8rem;
    }
    
    .tfu-tasks-table th,
    .tfu-tasks-table td {
        padding: 0.4rem 0.2rem; /* Minimal padding */
    }
    
    /* Hide Type column on very small screens */
    .tfu-tasks-table th:nth-child(2), /* Type column */
    .tfu-tasks-table td:nth-child(2) {
        display: none;
    }
    
    /* Redistribute column widths without Type column */
    .tfu-tasks-table th:nth-child(1), /* Title */
    .tfu-tasks-table td:nth-child(1) {
        width: 25%; /* Reduced from 30% */
    }
    
    .tfu-tasks-table th:nth-child(3), /* Dates */
    .tfu-tasks-table td:nth-child(3) {
        width: 27%; /* Increased from 25% */
    }
    
    .tfu-tasks-table th:nth-child(4), /* Assigned To */
    .tfu-tasks-table td:nth-child(4) {
        width: 15%; /* Same */
    }
    
    .tfu-tasks-table th:nth-child(5), /* Task Status */
    .tfu-tasks-table td:nth-child(5) {
        width: 12%; /* Same */
    }
    
    .tfu-tasks-table th:nth-child(6), /* Latest Instance Status */
    .tfu-tasks-table td:nth-child(6) {
        width: 13%; /* Same */
    }
    
    .tfu-tasks-table th:nth-child(7), /* Actions */
    .tfu-tasks-table td:nth-child(7) {
        width: 8%; /* Increased from 5% */
    }
    
    /* Ultra-compact action buttons */
    .tfu-action-buttons button {
        width: 24px; /* Even smaller on very small screens */
        height: 24px;
        font-size: 12px; /* Smaller emoji */
    }
    
    .tfu-duplicate-btn {
        width: 22px;
        height: 22px;
    }
}

/* User Task Dashboard Styles */
.tfu-user-tasks { margin: 2rem 0; }

.tfu-no-tasks {
    text-align: center !important;
    padding: 3rem !important;
    color: #999 !important;
    font-style: italic !important;
    font-size: 1.1rem !important;
    width: 100% !important;
    display: table-cell !important;
    vertical-align: middle !important;
}

/* Center "No tasks found" message in tab content */
.tfu-tab-content p {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-style: italic;
    font-size: 1.1rem;
    margin: 0;
}

/* Center "No task performance data available" message */
.tfu-performance-report > p {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-style: italic;
    font-size: 1.1rem;
    margin: 0;
}

.tfu-tabs { 
    display: flex; 
    gap: 1rem; 
    margin-bottom: 1.5rem; 
    list-style: none; 
    padding: 0; 
    flex-wrap: wrap; 
}

/* Tab styling for LTR */
.tfu-tab { 
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: 2px solid transparent;
    cursor: pointer; 
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tfu-tab span {
    margin-left: 0.5rem;
}

.tfu-tab-badge {
    margin-left: 0.5rem;
}

/* RTL Support for tabs */
[dir="rtl"] .tfu-tab span {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .tfu-tab-badge {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* RTL Support for tab content alignment */
[dir="rtl"] .tfu-tab {
    text-align: right;
}

[dir="rtl"] .tfu-tabs {
    direction: rtl;
}

/* Navigation tabs RTL support */
[dir="rtl"] .tfu-nav-tab {
    text-align: right;
}

[dir="rtl"] .tfu-nav-tabs {
    direction: rtl;
}

/* Icon spacing in RTL */
[dir="rtl"] .tfu-nav-tab span {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Filter form RTL support */
[dir="rtl"] .tfu-filter-actions {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] #tfu-filter-form {
    direction: rtl;
}

/* Toolbar RTL support */
[dir="rtl"] .tfu-toolbar-nav {
    direction: rtl;
}

[dir="rtl"] .tfu-toolbar-item {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .tfu-toolbar-item:last-child {
    margin-right: 0;
}

/* Performance report RTL support */
[dir="rtl"] .tfu-performance-report {
    direction: rtl;
    text-align: right;
}

/* Task Cards Grid Layout */
.tfu-task-cards, 
.tfu-task-cards-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 1.5rem; 
}

.tfu-task-card { 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.07); 
    padding: 1.5rem; 
    min-width: 280px; 
    max-width: 350px; 
    flex: 1 1 300px; 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    box-sizing: border-box;
}

.tfu-task-card-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.tfu-task-title { font-size: 1.1rem; font-weight: 700; color: #333; }
.tfu-task-card-dates { font-size: 0.95rem; color: #666; display: flex; gap: 1.5rem; }
.tfu-task-card-desc { font-size: 0.98rem; color: #444; margin: 0.5rem 0; }
.tfu-task-card-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.tfu-status-btn { background: #3498db; color: #fff; border: none; border-radius: 4px; padding: 0.4rem 1rem; cursor: pointer; font-size: 0.95rem; transition: background 0.2s; }
.tfu-status-btn:hover { background: #1976d2; }

/* Late badge */
.tfu-late-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 4px 0;
    width: fit-content;
    text-align: center;
}

@media (max-width: 900px) { .tfu-task-cards { flex-direction: column; } .tfu-task-card { max-width: 100%; } }

/* Notifications list */
.tfu-notification-list { display:flex; flex-direction:column; gap:1rem; }
.tfu-notification-item { background:#fff; border-radius:6px; padding:1rem 1.25rem; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.tfu-notification-item.unread { border-left:4px solid #3498db; }
.tfu-notification-item.read { opacity:0.7; }
.tfu-notif-header { font-weight:600; margin-bottom:0.4rem; }
.tfu-notif-body { margin-bottom:0.4rem; }
.tfu-notif-date { font-size:0.85rem; color:#666; }

/* Status History Table */
.tfu-status-history-table-wrapper {
    margin-top: 1rem;
    width: 100%;
    overflow-x: auto;
}

.tfu-status-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tfu-status-history-table th,
.tfu-status-history-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tfu-status-history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tfu-status-history-table td {
    text-align: center;
    vertical-align: middle;
}

/* Alternating row backgrounds for better readability */
.tfu-status-history-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.tfu-status-history-table tbody tr:nth-child(odd) {
    background: #fff;
}

.tfu-status-history-table tbody tr:hover {
    background: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

/* Right-align date/time column for better readability */
.tfu-status-history-table td:nth-child(3) {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Center-align status column */
.tfu-status-history-table td:nth-child(1) {
    text-align: center;
}

/* Left-align Applied To and Changed By columns */
.tfu-status-history-table td:nth-child(2),
.tfu-status-history-table td:nth-child(4) {
    text-align: center;
}

/* Left-align Remark column */
.tfu-status-history-table td:nth-child(5) {
    text-align: left;
    font-style: italic;
    color: #666;
}

.tfu-no-status-history {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-style: italic;
    font-size: 1.1rem;
}

/* Status badges in history table */
.tfu-status-history-table .tfu-status {
    padding: 0.3rem 0.8rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 80px;
    display: inline-block;
}

/* Enhanced Task Completion Modal Styles */
.tfu-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    backdrop-filter: blur(2px);
}

.tfu-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tfu-modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e1e1e1;
    position: relative;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.tfu-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    padding-right: 30px;
}

.tfu-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tfu-modal-close:hover {
    opacity: 1;
}

.tfu-modal-body {
    padding: 25px;
}

.tfu-modal-body p {
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.5;
}

.tfu-active-instances-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0 20px 0;
    max-height: 120px;
    overflow-y: auto;
    border-left: 4px solid #007cba;
}

.tfu-active-instances-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e1e1e1;
}

.tfu-active-instances-list li:last-child {
    border-bottom: none;
}

.tfu-instance-name {
    font-weight: 500;
    color: #2c3e50;
    flex: 1;
}

.tfu-instance-status {
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    padding: 3px 8px;
    margin-left: 10px;
}

.tfu-choice-options {
    margin: 20px 0;
}

.tfu-choice-option {
    display: block;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.tfu-choice-option:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.tfu-choice-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
}

.tfu-choice-option input[type="radio"]:checked ~ .tfu-choice-label {
    color: #007cba;
}

.tfu-choice-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background: #f0f8ff;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.tfu-choice-label {
    display: block;
    font-size: 14px;
    line-height: 1.4;
}

.tfu-choice-label strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.tfu-choice-label small {
    color: #666;
    font-size: 13px;
}

.tfu-remarks-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.tfu-remarks-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.tfu-remarks-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.tfu-remarks-section input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.tfu-modal-footer {
    padding: 15px 25px 25px;
    text-align: right;
    border-top: 1px solid #e1e1e1;
}

.tfu-modal-footer .button {
    margin-left: 10px;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.tfu-modal-footer .button:first-child {
    margin-left: 0;
}

.tfu-modal-footer .button:not(.button-primary) {
    background: #f1f1f1;
    color: #333;
}

.tfu-modal-footer .button:not(.button-primary):hover {
    background: #e1e1e1;
}

.tfu-modal-footer .button-primary {
    background: #007cba;
    color: white;
}

.tfu-modal-footer .button-primary:hover {
    background: #005a87;
}

.tfu-modal-footer .button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tfu-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .tfu-modal-header,
    .tfu-modal-body,
    .tfu-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .tfu-choice-option {
        padding: 12px;
    }
    
    .tfu-modal-footer {
        text-align: center;
    }
    
    .tfu-modal-footer .button {
        margin: 5px;
        display: inline-block;
    }
}

/* Animation for modal appearance */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.tfu-modal-overlay.show .tfu-modal-content {
    animation: modalFadeIn 0.3s ease-out;
} 