/**
 * Risk Meters CSS
 * Styling for dynamic risk visualization with color-changing risk meters
 */

.risk-meter {
    position: relative;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f0f0f0;
    margin: 10px 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.risk-meter-fill {
    height: 100%;
    transition: width 0.5s ease, background-color 0.5s ease;
}

.risk-meter-label {
    position: absolute;
    top: 0;
    left: 5px;
    right: 5px;
    line-height: 24px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.risk-badge {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
    text-align: center;
    min-width: 70px;
}

/* Risk level color classes - with more subtle colors */
.risk-low {
    background-color: rgba(75, 192, 192, 0.6); /* Teal/Green with lower opacity */
    color: white;
}

.risk-medium {
    background-color: rgba(255, 206, 86, 0.6); /* Yellow/Amber with lower opacity */
    color: #212529; /* Dark text for better contrast on yellow */
}

.risk-high {
    background-color: rgba(255, 99, 132, 0.6); /* Red/Pink with lower opacity */
    color: white;
}

.risk-critical {
    background-color: rgba(153, 102, 255, 0.6); /* Purple with lower opacity */
    color: white;
}

.risk-unknown {
    background-color: #6c757d;
    color: white;
}

/* Risk meters at different sizes */
.risk-meter-sm {
    height: 16px;
    border-radius: 8px;
}

.risk-meter-sm .risk-meter-label {
    line-height: 16px;
    font-size: 10px;
}

.risk-meter-lg {
    height: 32px;
    border-radius: 16px;
}

.risk-meter-lg .risk-meter-label {
    line-height: 32px;
    font-size: 14px;
}

/* Animation for risk meter when changing value */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.risk-meter-animate .risk-meter-fill {
    animation: pulse 1s ease;
}

/* Horizontal risk level legend */
.risk-legend {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.risk-legend-item {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.risk-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 4px;
}

/* Risk trends */
.risk-trend {
    display: inline-block;
    margin-left: 5px;
}

.risk-trend-up {
    color: rgba(255, 99, 132, 0.9); /* Red/Pink from chart */
}

.risk-trend-down {
    color: rgba(75, 192, 192, 0.9); /* Teal/Green from chart */
}

.risk-trend-stable {
    color: rgba(255, 206, 86, 0.9); /* Yellow/Amber from chart */
}