/* public/css/duration-analysis.css */
/* Основана на ваших существующих стилях из portfolio-builder */

.duration-analysis-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: #4a6cf7;
}

.page-subtitle {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 30px;
}

/* Панель фильтров (аналогично portfolio-builder) */
.filters-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #4a6cf7 0%, #3a56d4 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin: 8px 0;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* Индикаторы дюрации в таблице */
.duration-low { color: #10b981; }
.duration-medium { color: #f59e0b; }
.duration-high { color: #ef4444; }

.duration-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.duration-low-bg { background: rgba(16, 185, 129, 0.15); }
.duration-medium-bg { background: rgba(245, 158, 11, 0.15); }
.duration-high-bg { background: rgba(239, 68, 68, 0.15); }

/* График */
.chart-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

/* Легенда */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

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

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

/* Адаптивность */
@media (max-width: 768px) {
    .duration-analysis-page {
        padding: 15px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Добавьте эти стили в ваш CSS файл */
.stats-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stats-row:last-child {
    margin-bottom: 0;
}

.stat-item {
    text-align: center;
    flex: 1;
    padding: 0 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.stat-total .stat-value {
    color: #2c3e50;
}

.stat-warning .stat-value {
    color: #f39c12;
}

.stat-danger .stat-value {
    color: #e74c3c;
}

.stat-info .stat-value {
    color: #3498db;
}

.stat-success .stat-value {
    color: #27ae60;
    font-size: 28px;
}

.stat-divider {
    position: relative;
}

.stat-divider::before {
    content: "−";
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 20px;
}

.stat-result {
    position: relative;
}

.stat-result::before {
    content: "=";
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 20px;
    font-weight: bold;
}

/* Статистика в два ряда */
.stats-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stats-row:last-child {
    margin-bottom: 0;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

.stat-item {
    text-align: center;
    flex: 1;
    padding: 0 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

/* Цвета */
.stat-total .stat-value {
    color: #2c3e50;
}

.stat-warning .stat-value {
    color: #f39c12;
}

.stat-danger .stat-value {
    color: #e74c3c;
}

.stat-info .stat-value {
    color: #3498db;
}

.stat-success .stat-value {
    color: #27ae60;
    font-size: 28px;
}

/* Разделители */
.stat-divider {
    position: relative;
}

.stat-divider::before {
    content: "−";
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 20px;
}

.stat-result {
    position: relative;
}

.stat-result::before {
    content: "=";
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 20px;
    font-weight: bold;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.market-stats {
    margin-bottom: 10px;
}

.filter-stats-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin: 10px 0;
}

.filter-stats {
    margin: 0;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    text-align: center;
    position: relative;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
}

/* Карточки с вычитанием */
.stat-card-subtraction {
    padding-left: 40px;
}

.stat-subtraction-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 20px;
    font-weight: normal;
}

/* Итоговая карточка */
.stat-card-result {
    padding-left: 40px;
}

.stat-result-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 20px;
    font-weight: bold;
}

/* Цвета для значений исключенных бумаг */
.stat-color-orange {
    color: #f39c12 !important;
}

.stat-color-red {
    color: #e74c3c !important;
}

.stat-color-blue {
    color: #3498db !important;
}

.stat-color-green {
    color: #27ae60 !important;
    font-size: 28px !important;
}

/* Стили для итогового значения */
.stat-value-result {
    color: #27ae60;
    font-size: 28px;
}

.stat-label-result {
    color: #27ae60;
    font-weight: bold;
}

.legend-container {
    background: #f8f9fa;
    padding: 10px;
    margin-top: 20px;
    border-radius: 5px;
    font-size: 13px;
}

.legend-badge {
    margin-left: 10px;
}

.filters-info {
    background: #e8f4fd;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.filters-info-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-info-icon {
    color: #3498db;
    font-size: 18px;
}

.filters-info-badge {
    margin-left: 8px;
}

.adaptive-stats {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}
.adaptive-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}
.adaptive-stats .stat-card {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    text-align: center;
}
.adaptive-stats .stat-value {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}
.adaptive-stats .stat-label {
    font-size: 13px;
    color: #666;
}
.adaptive-stats .stats-note {
    font-size: 14px;
    color: #555;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    margin-top: 10px;
}

.composite-rating {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    margin: 0 auto;
}

.rating-high {
    background-color: #10b981;
    color: white;
}

.rating-medium {
    background-color: #f59e0b;
    color: white;
}

.rating-low {
    background-color: #ef4444;
    color: white;
}

.quality-badge {
    margin-top: 3px;
    color: #fbbf24;
    font-size: 10px;
}