/* Worklist Module Styles - Matching Radiology Design */

/* Filter Section */
.worklist-filter-section {
    margin-bottom: 24px;
}

.filter-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #2f3a4f;
    color: white;
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-header h3 i {
    color: white;
}

.collapse-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.collapse-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.filter-body {
    padding: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-wrapper {
    position: relative;
}

.filter-dropdown {
    width: 100%;
    padding: 10px 35px 10px 12px;
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-dropdown:hover {
    border-color: #556ee6;
}

.filter-dropdown:focus {
    outline: none;
    border-color: #556ee6;
    box-shadow: 0 0 0 3px rgba(85, 110, 230, 0.1);
}

.dropdown-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #74788d;
    pointer-events: none;
    font-size: 12px;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: #98a6ad;
}

.search-input:hover {
    border-color: #556ee6;
}

.search-input:focus {
    outline: none;
    border-color: #556ee6;
    box-shadow: 0 0 0 3px rgba(85, 110, 230, 0.1);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #74788d;
    pointer-events: none;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
}

.loading-content {
    text-align: center;
}

.loading-content i {
    color: #556ee6;
    margin-bottom: 16px;
}

.loading-content p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Worklist Table Container */
.worklist-table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    overflow-y: visible;
}

.worklist-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.worklist-table thead {
    background: #f8f9fc;
}

.worklist-table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e9f2;
    white-space: nowrap;
}

.worklist-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
    overflow: hidden;
    word-wrap: break-word;
}

/* Action column specific styling */
.worklist-table th:last-child,
.worklist-table td:last-child {
    width: 150px;
    min-width: 150px;
    text-align: center;
    padding: 16px 8px;
}

.worklist-table tbody tr {
    transition: background 0.2s;
    background: #ffffff;
}

.worklist-table tbody tr:hover {
    background: #f8f9fc;
}

.worklist-table tbody tr:last-child td {
    border-bottom: none;
}

/* Severity Indicators - Pill Shaped */
.severity-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.severity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.severity-urgent {
    background: #ffebee;
    color: #c62828;
}

.severity-urgent .severity-dot {
    background: #c62828;
}

.severity-priority {
    background: #fff3e0;
    color: #f57c00;
}

.severity-priority .severity-dot {
    background: #f57c00;
}

.severity-normal {
    background: #e8f5e9;
    color: #2e7d32;
}

.severity-normal .severity-dot {
    background: #2e7d32;
}

/* Action Buttons */
.btn-action-worklist {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.btn-view-pacs {
    background: #556ee6;
    color: #ffffff;
}

.btn-view-pacs:hover {
    background: #4a5fd4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(85, 110, 230, 0.3);
}

.btn-write-report {
    background: #556ee6;
    color: #ffffff;
}

.btn-write-report:hover {
    background: #4a5fd4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(85, 110, 230, 0.3);
}

.btn-action-worklist i {
    font-size: 14px;
}

/* Date Badge */
.date-badge {
    display: inline-block;
    background: #f3f4f6;
    color: #666;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: #ccc;
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    margin-top: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.empty-state i {
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 20px;
}

.empty-state p {
    color: #999;
    font-size: 14px;
}

/* Form Control Base Styles */
.form-control {
    font-family: inherit;
}

/* Access Denied Message */
.access-denied-message {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 40px;
}

.access-denied-content {
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 60px 40px;
    max-width: 500px;
}

.access-denied-content i {
    color: #f46a6a;
    margin-bottom: 24px;
}

.access-denied-content h2 {
    color: #2f3a4f;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.access-denied-content p {
    color: #666;
    font-size: 16px;
    margin-bottom: 12px;
}

.access-denied-content p strong {
    color: #2f3a4f;
    font-weight: 600;
}

.access-denied-content .btn {
    padding: 12px 24px;
    background: #556ee6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.access-denied-content .btn:hover {
    background: #4a5fd4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 110, 230, 0.3);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .filter-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .worklist-table {
        font-size: 12px;
    }
    
    .worklist-table th,
    .worklist-table td {
        padding: 12px 10px;
    }
    
    .worklist-table th {
        font-size: 11px;
        padding: 12px 8px;
    }
    
    .worklist-table td {
        font-size: 12px;
        padding: 12px 8px;
    }
    
    /* Action column on tablet */
    .worklist-table th:last-child,
    .worklist-table td:last-child {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        padding: 12px 6px;
    }
    
    .btn-action-worklist {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .worklist-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    /* Add scroll indicator for mobile */
    .worklist-table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .worklist-table-container.scrollable::after {
        opacity: 1;
    }
    
    .worklist-table {
        min-width: 900px;
    }
    
    .worklist-table th {
        font-size: 10px;
        padding: 10px 6px;
        letter-spacing: 0.3px;
    }
    
    .worklist-table td {
        font-size: 11px;
        padding: 10px 6px;
    }
    
    /* Action column on mobile */
    .worklist-table th:last-child,
    .worklist-table td:last-child {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        padding: 10px 4px;
    }
    
    .btn-action-worklist {
        padding: 5px 8px;
        font-size: 10px;
        gap: 3px;
    }
    
    .btn-action-worklist i {
        font-size: 12px;
    }
    
    .severity-indicator {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .date-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .worklist-filter-section {
        margin-bottom: 16px;
    }
    
    .filter-card {
        border-radius: 8px;
    }
    
    .filter-header {
        padding: 12px 16px;
    }
    
    .filter-header h3 {
        font-size: 14px;
    }
    
    .filter-body {
        padding: 16px;
    }
    
    .worklist-table-container {
        border-radius: 8px;
        margin: 0 -10px;
        border-radius: 0;
    }
    
    .worklist-table {
        min-width: 800px;
    }
    
    .worklist-table th {
        font-size: 9px;
        padding: 8px 4px;
    }
    
    .worklist-table td {
        font-size: 10px;
        padding: 8px 4px;
    }
    
    .btn-action-worklist {
        padding: 5px 8px;
        font-size: 10px;
    }
    
    .severity-indicator {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    .severity-dot {
        width: 6px;
        height: 6px;
    }
    
    .date-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    .empty-state {
        padding: 60px 20px;
    }
    
    .empty-state i {
        font-size: 48px;
    }
    
    .empty-state h3 {
        font-size: 18px;
    }
    
    .empty-state p {
        font-size: 13px;
    }
}

/* Enhanced scrollbar for better UX on desktop */
.worklist-table-container::-webkit-scrollbar {
    height: 12px;
}

.worklist-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
    margin: 0 4px;
}

.worklist-table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.worklist-table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox scrollbar */
.worklist-table-container {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    .btn-action-worklist {
        min-height: 36px;
        min-width: 36px;
    }
    
    .worklist-table tbody tr {
        min-height: 50px;
    }
}

/* Better spacing for smaller screens */
@media (max-width: 1024px) {
    .worklist-table th:first-child,
    .worklist-table td:first-child {
        padding-left: 12px;
    }
    
    .worklist-table th:last-child,
    .worklist-table td:last-child {
        padding-right: 12px;
    }
}

/* Improve readability on tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .worklist-table th {
        font-size: 12px;
    }
    
    .worklist-table td {
        font-size: 13px;
    }
}
