/* Import Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Global Styles */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.legacy-outer-table {
    background-color: #00003E;
}

/* Modern Link Styles */
a, .btn-link {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover, .btn-link:hover {
    color: #2980b9;
    text-decoration: none;
}

/* Modern Button Styles */
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* Modern Focus Styles */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    outline: none;
}

/* Content Styles */
.content {
    padding-top: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1rem;
}

h1:focus {
    outline: none;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    color: #34495e;
}

h3 {
    font-size: 1.5rem;
    color: #34495e;
}

/* Form Validation Styles */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid #27ae60;
    border-radius: 4px;
}

.invalid {
    outline: 2px solid #e74c3c;
    border-radius: 4px;
}

.validation-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Form Controls */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Modern Error Boundary */
.blazor-error-boundary {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    padding: 1.5rem 2rem;
    color: white;
    border-radius: 12px;
    margin: 1rem;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blazor-error-boundary::before {
    content: "⚠️";
    font-size: 2rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page or contact support.";
    font-weight: 500;
}

/* Modern Checkbox */
.darker-border-checkbox.form-check-input {
    border-color: #6c757d;
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: #3498db;
    border-color: #3498db;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: #495057;
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #3498db 0%, #9b59b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-modern {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

.rounded-modern {
    border-radius: 12px !important;
}

/* ============================================================
 * Worker Role health — banner + detail page (/admin/worker-health)
 * ============================================================ */
.wh-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 14px;
    color: inherit;
    border: 1px solid transparent;
}

.wh-banner-left { display: flex; align-items: center; gap: 12px; }
.wh-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.wh-banner-title { font-size: 17px; font-weight: 600; }
.wh-banner-sub { font-size: 13px; opacity: 0.85; }
.wh-banner-right { text-align: right; }
.wh-banner-count { font-size: 20px; font-weight: 600; }

.wh-healthy  { background: #e6f4ea; border-color: #a8d5b5; }
.wh-healthy  .wh-banner-title { color: #1a7f37; }
.wh-healthy  .wh-dot { background: #1a7f37; }

.wh-degraded { background: #fef3cd; border-color: #f2d98a; }
.wh-degraded .wh-banner-title { color: #8a6100; }
.wh-degraded .wh-dot { background: #cc9a00; }

.wh-offline  { background: #fbe3e4; border-color: #eeb3b6; }
.wh-offline  .wh-banner-title { color: #a3232b; }
.wh-offline  .wh-dot { background: #a3232b; }

.wh-unknown  { background: #eceff1; border-color: #cfd8dc; }
.wh-unknown  .wh-banner-title { color: #455a64; }
.wh-unknown  .wh-dot { background: #78909c; }

.wh-banner:hover { filter: brightness(0.98); }

/* Metric cards */
.wh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.wh-card { background: #f6f7f9; border-radius: 8px; padding: 14px 16px; }
.wh-card-label { font-size: 13px; color: #667; }
.wh-card-value { font-size: 24px; font-weight: 600; }
.wh-card-value.danger { color: #a3232b; }
.wh-card-value.warning { color: #8a6100; }

/* Jobs table */
.wh-jobs { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e2e5ea; border-radius: 12px; overflow: hidden; }
.wh-jobs th { text-align: left; font-size: 12px; color: #889; font-weight: 500; padding: 8px 14px; border-bottom: 1px solid #e2e5ea; }
.wh-jobs td { padding: 11px 14px; border-bottom: 1px solid #eef0f3; font-size: 14px; vertical-align: top; }
.wh-jobs tr:last-child td { border-bottom: none; }
.wh-row-failed { background: #fbe3e4; }
.wh-row-stale  { background: #fef3cd; }
.wh-status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.wh-status-dot.healthy { background: #1a7f37; }
.wh-status-dot.failed  { background: #a3232b; }
.wh-status-dot.stale   { background: #cc9a00; }
.wh-status-dot.never   { background: #b0b7c0; }
.wh-job-name { font-weight: 500; }
.wh-job-note { font-size: 12px; margin-top: 2px; }
.wh-job-note.failed { color: #a3232b; }
.wh-job-note.stale  { color: #8a6100; }
.wh-muted { color: #778; font-size: 13px; }
