:root {
    --status-migrated: #28a745;
    --status-not-migrated: #e08471;
    --status-possibly: #a48300;
    --status-pending: #ffc107;
    --status-confirmed: #28a745;
    --status-rejected: #dc3545;
    --status-manual: #17a2b8;
    --status-deprecated: #6f42c1;
    --confidence-high: #28a745;
    --confidence-medium: #ffc107;
    --confidence-low: #dc3545;
}

body {
    background-color: #f8f9fa;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.config-panel {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.sticky-summary {
    position: sticky;
    left: 0;
    z-index: 10;
    border-right: 1px solid #eee;
    box-shadow: 4px 0 8px rgba(0,0,0,0.05);
}

.workspace-tile {
    min-width: 220px;
    max-width: 450px;
    height: auto;
    min-height: 70px;
    background: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.workspace-tile .ws-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-tile .ws-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
    font-size: 0.7rem;
    font-weight: 600;
}

.workspace-tile .ws-stats span {
    white-space: nowrap;
}

.workspace-tile .ws-chart {
    width: 100%;
    height: 10px;
}

.group-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    font-weight: 600;
    align-items: center;
}

.group-stats span {
    white-space: nowrap;
}

.table-container {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    display: flex;
    flex-direction: column;
}

.badge-confidence-high {
    background-color: var(--confidence-high);
}

.badge-confidence-medium {
    background-color: var(--confidence-medium);
    color: #000;
}

.badge-confidence-low {
    background-color: var(--confidence-low);
}

.badge-status-pending {
    background-color: var(--status-pending);
    color: #000;
}

.badge-status-not-matched {
    background-color: var(--status-not-migrated);
    color: #000;
}

.badge-status-confirmed {
    background-color: var(--status-confirmed);
    color: #fff;
}

.badge-status-rejected {
    background-color: var(--status-rejected);
    color: #fff;
}

.badge-status-manual {
    background-color: var(--status-manual);
    color: #fff;
}

.badge-status-deprecated {
    background-color: var(--status-deprecated);
    color: #fff;
}

.status-migrated {
    color: var(--status-migrated);
}

.status-not-migrated {
    color: var(--status-not-migrated);
}

.status-possibly {
    color: var(--status-possibly);
}

.status-deprecated {
    color: var(--status-deprecated);
}

/* Multiple matches styling */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.match-item {
    padding: 0.25rem;
    border-left: 2px solid #dee2e6;
    margin-left: 0.25rem;
}

.match-item:first-child {
    border-color: #0d6efd;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.filters-row {
    margin-bottom: 20px;
}

.pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: #f8f9fa;
}

.export-btn {
    margin-left: 10px;
}

.match-details {
    font-size: 0.85rem;
    color: #6c757d;
}

.error-banner {
    display: none;
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    min-width: 400px;
    max-width: 600px;
}

.repo-link {
    color: #0d6efd;
    text-decoration: none;
}

.repo-link:hover {
    text-decoration: underline;
}

.status-card {
    flex: 1 1 240px;
    min-width: 220px;
}

.status-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
}

/* Sticky Headers & Scroll */
.table-responsive {
    /* Allow the table to grow while leaving space for navbar, stats, and padding */
    height: calc(100vh - 260px);
    min-height: 320px;
    overflow: auto;
    border: 1px solid #dee2e6;
    position: relative;
    flex: 1 1 auto;
}

thead th {
    position: sticky;
    background-color: #f8f9fa;
    z-index: 10;
    box-shadow: inset 0 -1px 0 #dee2e6;
    /* Ensure borders are visible */
    border-bottom: 1px solid #dee2e6;
    background-clip: padding-box;
}

#tableHeaderRow th {
    top: 0;
    vertical-align: middle;
}

#tableFilterRow th {
    /* Top is set dynamically via JS to match header height */
    z-index: 9;
}

/* Compact table styles */
.table-sm td, .table-sm th {
    padding: 0.2rem 0.3rem;
    font-size: 0.8rem;
    vertical-align: middle;
    white-space: nowrap;
}

.table-sm td {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-sm .badge {
    font-size: 0.65rem;
    padding: 0.2em 0.4em;
}

.form-control-sm, .form-select-sm {
    padding: 0.1rem 0.2rem;
    font-size: 0.75rem;
    height: auto;
}

/* Resizable columns */
.resizable-th {
    position: relative;
    cursor: pointer;
}

.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    background-color: transparent;
}

.resizer:hover {
    background-color: #0d6efd;
}

.resizing {
    background-color: #0d6efd;
}

/* Column visibility */
.column-hidden {
    display: none !important;
}

.column-selector {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
    min-width: 220px;
}

.column-selector li {
    list-style: none;
}

.column-selector .form-check {
    padding: 0.5rem 1rem;
    margin: 0;
    cursor: pointer;
    padding-left: 1.75rem;
}

.column-selector .form-check:hover {
    background-color: #f8f9fa;
}

.column-selector .form-check-input {
    cursor: pointer;
    margin-top: 0.15rem;
}

.column-selector .form-check-label {
    cursor: pointer;
    width: 100%;
    user-select: none;
}

/* Spinning animation for loading indicator */
.spinning {
    animation: spin 1s linear infinite;
}

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

/* Loading tile styles */
.loading-tile {
    min-width: 220px;
    max-width: 450px;
    min-height: 70px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
}
