/* Economic Cycle Analysis Styles */

/* Valuation Scale */
.valuation-scale {
    margin: 20px 0;
}

.scale-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scale-segment {
    flex: 1;
    position: relative;
}

.scale-segment.undervalued {
    background: linear-gradient(90deg, #217EA0, #55C5E5);
}

.scale-segment.neutral {
    background: linear-gradient(90deg, #f3f4f6, #e5e7eb);
}

.scale-segment.overvalued {
    background: linear-gradient(90deg, #EE5F0F, #f97316);
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.label-left {
    color: #217EA0;
}

.label-center {
    color: #6b7280;
}

.label-right {
    color: #EE5F0F;
}

/* Valuation Indicators */
.valuation-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.valuation-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.valuation-bar {
    flex: 1;
    height: 20px;
    background: linear-gradient(90deg, #217EA0 0%, #f3f4f6 50%, #EE5F0F 100%);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.min-label, .max-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.valuation-fill {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #000;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: all 0.3s ease;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.valuation-label {
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 80px;
}

/* Deviation Values */
.deviation-value {
    font-weight: 500;
}

.deviation-value.positive {
    color: #EE5F0F;
}

.deviation-value.negative {
    color: #217EA0;
}

/* Market Cycle Position */
.cycle-position {
    margin: 20px 0;
}

.cycle-bar {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.cycle-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.cycle-segment[data-phase="recession"] {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.cycle-segment[data-phase="recovery"] {
    background: linear-gradient(135deg, #ea580c, #f97316);
}

.cycle-segment[data-phase="expansion"] {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.cycle-segment[data-phase="peak"] {
    background: linear-gradient(135deg, #ca8a04, #eab308);
}

.cycle-indicator {
    position: absolute;
    top: -5px;
    width: 12px;
    height: 12px;
    background: #000;
    border: 3px solid #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    transition: all 0.5s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cycle-summary {
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #217EA0;
}

/* Table Enhancements */
#indicators-table {
    font-size: 0.9rem;
}

#indicators-table th {
    background-color: #1f2937;
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

#indicators-table td {
    vertical-align: middle;
    border-color: #e5e7eb;
}

#indicators-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Summary Cards */
.card.text-center {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.card.text-center:hover {
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .valuation-bar-container {
        gap: 4px;
    }
    
    .min-label, .max-label {
        font-size: 0.7rem;
        min-width: 35px;
    }
    
    .cycle-segment {
        font-size: 0.75rem;
    }
    
    .scale-labels {
        font-size: 0.75rem;
    }
    
    #indicators-table {
        font-size: 0.8rem;
    }
    
    .valuation-label {
        min-width: 60px;
        font-size: 0.75rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #217EA0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Insights Styling */
#insights-content {
    line-height: 1.6;
}

.insight-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #217EA0;
}

.insight-item.positive {
    border-left-color: #16a34a;
}

.insight-item.negative {
    border-left-color: #EE5F0F;
}

.insight-item.neutral {
    border-left-color: #6b7280;
}
