/* Risk Visualization Styles */
.risk-visualization-widget {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.risk-gauge-container {
    position: relative;
    text-align: center;
}

.risk-gauge {
    max-width: 400px;
    margin: 0 auto;
}

.risk-score-text {
    fill: #212529;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.risk-score-number {
    transition: all 0.3s ease;
}

.gauge-segments {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.segment-btn {
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 25px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.segment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.segment-btn.active {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.segment-btn.low-risk.active {
    border-color: #28a745;
    color: #28a745;
}

.segment-btn.medium-risk.active {
    border-color: #ffc107;
    color: #856404;
}

.segment-btn.high-risk.active {
    border-color: #dc3545;
    color: #dc3545;
}

/* Timeline Styles */
.risk-timeline {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.timeline-container {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

#risk-timeline-chart {
    max-width: 100%;
    height: auto;
}

.timeline-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

/* Breakdown Styles */
.risk-breakdown {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.breakdown-factors {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.factor-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.factor-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.factor-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.factor-name {
    font-weight: 500;
    color: #495057;
}

.factor-score {
    font-weight: bold;
    color: #212529;
}

.factor-item .progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.factor-item .progress-bar {
    transition: width 1.5s ease-out;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .risk-visualization-widget {
        padding: 20px;
    }
    
    .gauge-segments {
        flex-direction: column;
        align-items: center;
    }
    
    .segment-btn {
        width: 200px;
        justify-content: center;
    }
    
    .timeline-legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* Animation Classes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Tooltip Customization */
.tooltip-inner {
    max-width: 250px;
    text-align: left;
}

/* Loading State */
.risk-visualization-loading {
    text-align: center;
    padding: 60px 20px;
}

.risk-visualization-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 20px;
}

/* Comparison View */
.peer-comparison {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.peer-comparison h6 {
    margin-bottom: 10px;
    opacity: 0.9;
}

.peer-comparison .comparison-stat {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.peer-comparison .comparison-label {
    opacity: 0.9;
    font-size: 14px;
}