/* Enhanced PICMS Unified Status Management CSS */
/* UK HSE Compliant Color Coding System */

/* ==========================================
   UNIFIED STATUS COLOR SYSTEM
   ========================================== */

/* Open Status - Red #dc3545 */
.status-open,
.status-badge.status-danger,
.status-danger {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* Under Investigation Status - Orange #fd7e14 */
.status-under-investigation,
.status-investigating,
.status-badge.status-warning,
.status-warning {
    background-color: #fd7e14 !important;
    color: white !important;
    border-color: #fd7e14 !important;
}

/* Under Review Status - Blue #0d6efd */
.status-under-review,
.status-review,
.status-badge.status-info,
.status-info {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

/* Closed Status - Green #198754 */
.status-closed,
.status-completed,
.status-badge.status-success,
.status-success {
    background-color: #198754 !important;
    color: white !important;
    border-color: #198754 !important;
}

/* Overdue Status - Dark Red #721c24 */
.status-overdue,
.status-danger-dark {
    background-color: #721c24 !important;
    color: white !important;
    border-color: #721c24 !important;
    position: relative;
}

.status-overdue::after {
    content: ' ⏰';
    font-size: 0.875rem;
}

/* Neutral/Not Required Status - Gray #6b7280 */
.status-neutral,
.status-not-required,
.status-na {
    background-color: #6b7280 !important;
    color: white !important;
    border-color: #6b7280 !important;
}

/* ==========================================
   INVESTIGATION STATUS INDICATORS
   ========================================== */

.investigation-status-pending {
    background-color: #f59e0b !important;
    color: white !important;
}

.investigation-status-assigned {
    background-color: #3b82f6 !important;
    color: white !important;
}

.investigation-status-in-progress {
    background-color: #f59e0b !important;
    color: white !important;
    position: relative;
}

.investigation-status-in-progress::before {
    content: '🔄 ';
    animation: rotate 2s linear infinite;
}

.investigation-status-under-review {
    background-color: #0d6efd !important;
    color: white !important;
}

.investigation-status-completed {
    background-color: #10b981 !important;
    color: white !important;
}

.investigation-status-overdue {
    background-color: #dc2626 !important;
    color: white !important;
    font-weight: 600 !important;
}

.investigation-status-not-required {
    background-color: #9ca3af !important;
    color: white !important;
    opacity: 0.7;
}

/* ==========================================
   RIDDOR STATUS INDICATORS
   ========================================== */

.riddor-reportable {
    color: #dc2626 !important;
    font-weight: 700 !important;
}

.riddor-reportable::before {
    content: '🇬🇧 ';
    font-size: 0.75rem;
}

.riddor-not-reportable {
    color: #10b981 !important;
    font-weight: 500 !important;
}

.riddor-pending-assessment {
    color: #f59e0b !important;
    font-weight: 600 !important;
}

.riddor-pending-assessment::before {
    content: '❓ ';
}

/* ==========================================
   SEVERITY LEVEL INDICATORS
   ========================================== */

.severity-critical {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    color: white !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3) !important;
}

.severity-high {
    background: linear-gradient(135deg, #ea580c, #c2410c) !important;
    color: white !important;
    font-weight: 600 !important;
}

.severity-medium {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
}

.severity-low {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

/* ==========================================
   PRIORITY LEVEL INDICATORS
   ========================================== */

.priority-urgent {
    background-color: #7c2d12 !important;
    color: white !important;
    font-weight: 700 !important;
    animation: pulse-urgent 2s infinite;
}

.priority-high {
    background-color: #dc2626 !important;
    color: white !important;
    font-weight: 600 !important;
}

.priority-medium {
    background-color: #f59e0b !important;
    color: white !important;
}

.priority-low {
    background-color: #10b981 !important;
    color: white !important;
}

/* ==========================================
   STATUS BADGE STYLING
   ========================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    min-width: 60px;
    text-align: center;
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Large status badge variant */
.status-badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    min-width: 80px;
}

/* Small status badge variant */
.status-badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    border-radius: 0.25rem;
    min-width: 50px;
}

/* ==========================================
   INCIDENT TYPE INDICATORS
   ========================================== */

.incident-type-near-miss {
    color: #f59e0b;
}

.incident-type-near-miss::before {
    content: '⚠️ ';
}

.incident-type-first-aid {
    color: #10b981;
}

.incident-type-first-aid::before {
    content: '🩹 ';
}

.incident-type-medical-treatment {
    color: #3b82f6;
}

.incident-type-medical-treatment::before {
    content: '🏥 ';
}

.incident-type-reportable-injury {
    color: #dc2626;
}

.incident-type-reportable-injury::before {
    content: '🚨 ';
}

.incident-type-lost-time-injury {
    color: #7c2d12;
}

.incident-type-lost-time-injury::before {
    content: '❌ ';
}

.incident-type-property-damage {
    color: #6b7280;
}

.incident-type-property-damage::before {
    content: '🏗️ ';
}

.incident-type-environmental {
    color: #059669;
}

.incident-type-environmental::before {
    content: '🌍 ';
}

.incident-type-security {
    color: #7c2d12;
}

.incident-type-security::before {
    content: '🔒 ';
}

/* ==========================================
   TABLE ROW STATUS HIGHLIGHTING
   ========================================== */

.table-row-overdue {
    background-color: #fef2f2 !important;
    border-left: 4px solid #dc2626 !important;
}

.table-row-urgent {
    background-color: #fef2f2 !important;
    border-left: 4px solid #7c2d12 !important;
}

.table-row-riddor {
    background-color: #fef3c7 !important;
    border-left: 4px solid #f59e0b !important;
}

.table-row-completed {
    background-color: #f0fdf4 !important;
    border-left: 4px solid #10b981 !important;
}

/* ==========================================
   DASHBOARD WIDGET STATUS COLORS
   ========================================== */

.widget-status-excellent {
    border-left-color: #10b981 !important;
}

.widget-status-excellent .widget-indicator {
    background-color: #10b981;
}

.widget-status-good {
    border-left-color: #f59e0b !important;
}

.widget-status-good .widget-indicator {
    background-color: #f59e0b;
}

.widget-status-needs-improvement {
    border-left-color: #dc2626 !important;
}

.widget-status-needs-improvement .widget-indicator {
    background-color: #dc2626;
}

.widget-status-critical {
    border-left-color: #7c2d12 !important;
}

.widget-status-critical .widget-indicator {
    background-color: #7c2d12;
}

/* ==========================================
   PERFORMANCE TREND INDICATORS
   ========================================== */

.trend-positive {
    color: #10b981 !important;
}

.trend-positive::before {
    content: '📈 ';
}

.trend-negative {
    color: #dc2626 !important;
}

.trend-negative::before {
    content: '📉 ';
}

.trend-neutral {
    color: #6b7280 !important;
}

.trend-neutral::before {
    content: '➡️ ';
}

.trend-improving {
    color: #10b981 !important;
    font-weight: 600;
}

.trend-improving::after {
    content: ' ↗';
    font-size: 0.875rem;
}

.trend-declining {
    color: #dc2626 !important;
    font-weight: 600;
}

.trend-declining::after {
    content: ' ↘';
    font-size: 0.875rem;
}

.trend-stable {
    color: #6b7280 !important;
}

.trend-stable::after {
    content: ' →';
    font-size: 0.875rem;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes pulse-urgent {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

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

@keyframes blink-urgent {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.5;
    }
}

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */

.status-badge:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.status-badge[aria-pressed="true"] {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .status-badge {
        border-width: 2px !important;
        font-weight: 700 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .status-badge {
        transition: none;
    }
    
    .priority-urgent {
        animation: none;
    }
    
    .investigation-status-in-progress::before {
        animation: none;
    }
}

/* ==========================================
   DARK MODE SUPPORT
   ========================================== */

@media (prefers-color-scheme: dark) {
    .table-row-overdue {
        background-color: #451a1a !important;
    }
    
    .table-row-urgent {
        background-color: #451a1a !important;
    }
    
    .table-row-riddor {
        background-color: #451a03 !important;
    }
    
    .table-row-completed {
        background-color: #052e16 !important;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .status-badge {
        background-color: transparent !important;
        color: black !important;
        border: 1px solid black !important;
    }
    
    .status-overdue::after,
    .investigation-status-in-progress::before,
    .trend-positive::before,
    .trend-negative::before,
    .trend-neutral::before {
        display: none;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.status-indicator-large {
    width: 12px;
    height: 12px;
}

.status-text-only {
    background: none !important;
    color: inherit !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 600 !important;
}

.status-with-icon {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 640px) {
    .status-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.5rem;
        min-width: 45px;
    }
    
    .status-badge-lg {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        min-width: 60px;
    }
}