/**
 * Delegation Table Styles
 * Interactive Agent Delegation Table for Blueprint integration
 */

/* Container */
.delegation-table-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin: 16px 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Header */
.delegation-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
}

.delegation-table-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delegation-table-header h4 i {
    color: #06b8a0;
}

.delegation-table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-all-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.select-all-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #06b8a0;
}

/* Table Body */
.delegation-table-body {
    overflow-x: auto;
}

.interactive-delegation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.interactive-delegation-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.interactive-delegation-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.interactive-delegation-table th.col-select {
    width: 40px;
    text-align: center;
}

.interactive-delegation-table th.col-priority {
    width: 120px;
}

.interactive-delegation-table th.col-director {
    width: 160px;
}

.interactive-delegation-table th.col-instructions {
    min-width: 300px;
}

/* Table Rows */
.interactive-delegation-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.interactive-delegation-table tbody tr:hover {
    background: #f5f9ff;
}

.interactive-delegation-table tbody tr.selected {
    background: #e8f5e9 !important;
}

.interactive-delegation-table tbody tr.added-to-blueprint {
    opacity: 0.6;
    background: #f0f0f0;
}

.interactive-delegation-table tbody tr.added-to-blueprint::after {
    content: '✓ Added';
    position: absolute;
    right: 16px;
    color: #4caf50;
    font-size: 12px;
    font-weight: 500;
}

.interactive-delegation-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.interactive-delegation-table td.col-select {
    text-align: center;
}

.interactive-delegation-table td.col-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #06b8a0;
}

/* Priority Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.priority-badge.priority-critical {
    background: #ffebee;
    color: #c62828;
}

.priority-badge.priority-high {
    background: #fff3e0;
    color: #e65100;
}

.priority-badge.priority-medium {
    background: #fffde7;
    color: #f9a825;
}

.priority-badge.priority-low {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Director Badge */
.director-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* Row Priority Indicators */
.task-row.priority-critical {
    border-left: 4px solid #ef5350;
}

.task-row.priority-high {
    border-left: 4px solid #ff9800;
}

.task-row.priority-medium {
    border-left: 4px solid #ffeb3b;
}

.task-row.priority-low {
    border-left: 4px solid #4caf50;
}

/* Footer */
.delegation-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.selected-count {
    font-size: 14px;
    color: #666;
}

.selected-count .count-number {
    font-weight: 700;
    color: #06b8a0;
    font-size: 16px;
}

.add-to-blueprint-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #06b8a0 0%, #05a08c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-to-blueprint-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #05a08c 0%, #048f7c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 184, 160, 0.3);
}

.add-to-blueprint-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.add-to-blueprint-btn i {
    font-size: 16px;
}

/* Notification Toast */
.delegation-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #333;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 400px;
}

.delegation-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.delegation-notification.success {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
}

.delegation-notification.error {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
}

.delegation-notification.warning {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
}

.delegation-notification.info {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
}

.notification-message {
    flex: 1;
    font-size: 14px;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .delegation-table-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .delegation-table-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .add-to-blueprint-btn {
        width: 100%;
        justify-content: center;
    }
    
    .interactive-delegation-table th.col-instructions,
    .interactive-delegation-table td.col-instructions {
        min-width: 200px;
    }
    
    .delegation-notification {
        left: 20px;
        right: 20px;
        bottom: 10px;
    }
}

/* Blueprint Task Count Badges */
.task-badge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.task-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #06b8a0 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(6, 184, 160, 0.3);
}

.task-count-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 184, 160, 0.4);
}

.task-count-badge i {
    font-size: 11px;
}

/* Director Task Modal */
.director-task-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.director-task-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.director-task-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.director-task-modal-overlay.show .director-task-modal {
    transform: translateY(0);
}

.director-task-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
}

.director-task-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.director-task-modal-header h3 i {
    color: #06b8a0;
}

.director-task-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.director-task-modal-close:hover {
    opacity: 1;
}

.director-task-modal-body {
    padding: 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.director-task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.director-task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #ccc;
    transition: all 0.2s ease;
}

.director-task-item:hover {
    background: #f0f4f8;
}

.director-task-item.priority-critical {
    border-left-color: #ef5350;
}

.director-task-item.priority-high {
    border-left-color: #ff9800;
}

.director-task-item.priority-medium {
    border-left-color: #ffeb3b;
}

.director-task-item.priority-low {
    border-left-color: #4caf50;
}

.director-task-item.status-completed {
    opacity: 0.6;
    background: #e8f5e9;
}

.director-task-checkbox {
    margin-top: 2px;
}

.director-task-content {
    flex: 1;
}

.director-task-instructions {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
}

.director-task-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.director-task-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.director-task-actions {
    display: flex;
    gap: 8px;
}

.director-task-action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.director-task-action-btn.start {
    background: #e3f2fd;
    color: #1565c0;
}

.director-task-action-btn.start:hover {
    background: #bbdefb;
}

.director-task-action-btn.complete {
    background: #e8f5e9;
    color: #2e7d32;
}

.director-task-action-btn.complete:hover {
    background: #c8e6c9;
}

.director-task-action-btn.delete {
    background: #ffebee;
    color: #c62828;
}

.director-task-action-btn.delete:hover {
    background: #ffcdd2;
}

.director-task-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.task-summary {
    font-size: 14px;
    color: #666;
}

.task-summary strong {
    color: #06b8a0;
}

.no-tasks-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-tasks-message i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.no-tasks-message p {
    margin: 0;
    font-size: 14px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .delegation-table-container {
        background: #1e1e1e;
        border-color: #333;
    }
    
    .interactive-delegation-table thead {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .interactive-delegation-table th {
        color: #e0e0e0;
    }
    
    .interactive-delegation-table tbody tr {
        border-color: #333;
    }
    
    .interactive-delegation-table tbody tr:hover {
        background: #2a2a2a;
    }
    
    .delegation-table-footer {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .selected-count {
        color: #aaa;
    }
}
