/**
 * Management view styles - Patient Index (list) page.
 * Edit these to change the patient list table and pagination.
 */

/* =============================================================================
   Tables
   ============================================================================= */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background: #ffffff;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: #f7fafc;
}

/* Patient name link styling */
.patient-name-link {
    color: #3182ce;
    font-weight: 600;
    text-decoration: underline;
}

.patient-name-link:hover {
    color: #1a365d;
    text-decoration: underline;
}

.probability-cell {
    white-space: nowrap;
}

.probability-value {
    display: inline-flex;
    align-items: center;
}

.probability-link {
    display: inline-block;
    width: 4.75rem;
    text-align: left;
}

.sepsis-alert-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 9999px;
    background: #dc2626;
    box-shadow: 0 0 0 rgba(220, 38, 38, 0.7);
    animation: sepsis-pulse 1.4s infinite;
    flex: 0 0 auto;
    margin-left: -0.3rem;
}

@keyframes sepsis-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 0.5rem rgba(220, 38, 38, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* =============================================================================
   Sortable Columns
   ============================================================================= */

.table tbody tr.sorting {
    transition: transform 0.35s ease;
}

.sortable-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    user-select: none;
}

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sort-btn:hover {
    opacity: 1;
}

.sort-btn svg {
    width: 16px;
    height: 16px;
}

/* Sort Menu Popup */
.sort-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 35%;
    margin-top: 2px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    overflow: hidden;
    min-width: 150px;
}

.sort-menu.show {
    display: block;
}

.sort-option {
    display: block;
    width: 100%;
    padding: 0.4rem 0.75rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4a5568;
    transition: background-color 0.2s;
}

.sort-option:hover {
    background-color: #f7fafc;
}

/* =============================================================================
   Pagination
   ============================================================================= */

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #4a5568;
}

.pagination a:hover {
    background: #e2e8f0;
}

.pagination .current {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}
