/**
 * CHECKUP WEB INTERFACE - Стили для веб-интерфейса анкеты
 * 
 * Адаптивный дизайн для работы в iframe Getcourse
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.checkup-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
}

/* При работе в iframe убираем min-height для корректного расчета высоты */
body.in-iframe .checkup-container {
    min-height: auto;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Обработка завершения чекапа */
.processing-loader {
    text-align: center;
    padding: 60px 20px;
    background-color: #F8F8F8;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.processing-stage {
    font-size: 18px;
    font-weight: bold;
    color: #36454F;
    text-transform: uppercase;
    margin-bottom: 40px;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.circular-progress {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    position: relative;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: #D3D3D3;
    stroke-width: 4;
    stroke-dasharray: 3 6;
    stroke-linecap: round;
}

.progress-fill {
    fill: none;
    stroke: #36454F;
    stroke-width: 4;
    stroke-dasharray: 3 6;
    stroke-linecap: round;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.1s linear;
}

.progress-percent {
    font-size: 24px;
    font-weight: bold;
    color: #36454F;
    margin-top: 10px;
}

/* Ошибка */
.error {
    text-align: center;
    padding: 40px 20px;
    background-color: #ffebee;
    border-radius: 8px;
    border: 1px solid #f44336;
}

.error h2 {
    color: #f44336;
    margin-bottom: 15px;
}

.error button {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.error button:hover {
    background-color: #d32f2f;
}

/* Прогресс */
.progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.progress-group {
    font-size: 12px;
    color: #999;
}

/* Вопросы */
.questions-section {
    margin-top: 20px;
}

.group-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
}

.questions-list {
    margin-bottom: 30px;
}

.question-item {
    margin-bottom: 12px;
}

.question-btn {
    width: 100%;
    padding: 15px 20px;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333; /* Явно задаем цвет текста для предотвращения наследования белого цвета */
}

.question-btn:hover {
    border-color: #4CAF50;
    background-color: #f1f8f4;
}

.question-btn.answered {
    border-color: #f44336;
    background-color: #ffebee;
}

.question-history {
    margin-top: 4px;
    margin-bottom: 8px;
    margin-left: 20px;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-left: 3px solid #f44336;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    color: #666;
}

.question-history .history-label {
    font-weight: 500;
    margin-right: 8px;
}

.question-history .history-value {
    color: #f44336;
    font-weight: 600;
    margin-right: 8px;
}

.question-history .history-date {
    color: #999;
    font-size: 12px;
}

.question-marker {
    font-size: 20px;
    flex-shrink: 0;
}

.question-text {
    flex: 1;
    color: #333; /* Явно задаем цвет текста для предотвращения наследования белого цвета */
}

/* Кнопки действий */
.actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #757575;
    color: white;
}

.btn-secondary:hover {
    background-color: #616161;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-courses {
    background-color: #accde9;
    color: white;
}

.btn-courses:hover {
    background-color: #9bc0d8;
}

/* Результаты */
.results-section {
    margin-top: 20px;
}

.results-section h2 {
    font-size: 28px;
    margin-bottom: 25px;
    color: #333;
}

#results-content {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    line-height: 1.8;
}

#results-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #4CAF50;
}

/* Переопределение для мотивационного блока - белый цвет заголовка */
#results-content .recheckup-motivation .motivation-title {
    color: white;
    margin-top: 0;
}

#results-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

#results-content li {
    margin-bottom: 8px;
}

/* График */
/* Контейнер для графиков - теперь видимый для графиков индекса здоровья */
.chart-container {
    display: block; /* Показываем контейнер для графиков */
    margin: 30px 0;
    text-align: center;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.chart-container img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block; /* Гарантируем отображение изображения */
    margin: 0 auto; /* Центрируем изображение */
}

/* История */
.history-section {
    margin-top: 20px;
}

.history-section h2 {
    font-size: 28px;
    margin-bottom: 25px;
    color: #333;
}

#history-content {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

/* Утилиты */
.hidden {
    display: none !important;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .checkup-container {
        padding: 15px;
    }

    .group-title {
        font-size: 20px;
    }

    .question-btn {
        padding: 12px 15px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
    }
}

/* Для iframe */
html, body {
    overflow-x: hidden;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.questions-section,
.results-section,
.history-section {
    animation: fadeIn 0.3s ease;
}

/* Системы результатов с прогресс-барами */
.systems-results {
    margin-top: 20px;
}

.system-result-item {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.system-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.system-score {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.change-positive {
    color: #27AE60;
    font-weight: bold;
    margin-left: 8px;
}

.change-negative {
    color: #E74C3C;
    font-weight: bold;
    margin-left: 8px;
}

/* Прогресс-бары для систем */
.progress-bar-container {
    width: 100%;
    height: 30px;
    background-color: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-value {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.system-indicator {
    font-size: 18px;
    margin-left: 10px;
}

.score-bar-container {
    position: relative;
    width: 100%;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.score-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.score-text {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: bold;
    color: #333;
    z-index: 1;
}

/* LLM интерпретация */
.llm-interpretation {
    background-color: #f0f8ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.llm-interpretation h1,
.llm-interpretation h2,
.llm-interpretation h3,
.llm-interpretation h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #2196F3;
    font-weight: bold;
}

.llm-interpretation h1 {
    font-size: 24px;
}

.llm-interpretation h2 {
    font-size: 22px;
}

.llm-interpretation h3 {
    font-size: 20px;
}

.llm-interpretation h4 {
    font-size: 18px;
}

.llm-interpretation h2:first-child,
.llm-interpretation h3:first-child {
    margin-top: 0;
}

.llm-interpretation p {
    margin-bottom: 12px;
}

.llm-interpretation ul,
.llm-interpretation ol {
    margin-bottom: 12px;
    padding-left: 25px;
}

.llm-interpretation li {
    margin-bottom: 6px;
}

.llm-interpretation strong {
    font-weight: bold;
    color: #1976D2;
}

.llm-interpretation em {
    font-style: italic;
}

.llm-interpretation code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.llm-interpretation pre {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.llm-interpretation blockquote {
    border-left: 4px solid #2196F3;
    padding-left: 16px;
    margin-left: 0;
    margin-bottom: 12px;
    color: #666;
    font-style: italic;
}

/* Индикатор загрузки LLM */
.llm-loading {
    text-align: center;
    padding: 30px 20px;
    margin: 20px 0;
    background-color: #fff3e0;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

.llm-loading p {
    font-size: 18px;
    color: #f57c00;
    font-weight: bold;
    margin: 0;
}

#llm-loading-dots {
    display: inline-block;
    min-width: 20px;
    text-align: left;
}

/* Fallback для LLM (информация о программе) */
.llm-fallback {
    background-color: #fff9e6;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    line-height: 1.6;
    color: #333;
    margin-top: 20px;
}

.llm-fallback p {
    margin: 0;
    font-size: 16px;
}

/* Адаптивность для мобильных - системы результатов */
@media (max-width: 600px) {
    .system-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .system-name {
        min-width: auto;
        width: 100%;
    }
    
    .system-score {
        margin-top: 5px;
    }
    
    .score-bar-container {
        height: 25px;
    }
    
    .score-text {
        font-size: 11px;
    }
}

/* Intensity Selector - Выбор интенсивности симптома */
.intensity-selector {
    margin-top: 15px;
    padding: 20px;
    background-color: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.intensity-hint {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.intensity-title {
    font-size: 16px;
    font-weight: 600;
    color: #2196F3;
}

.intensity-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.intensity-btn {
    min-width: 45px;
    height: 45px;
    padding: 10px;
    /* background-color и border-color задаются через inline стили */
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intensity-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.intensity-btn.selected {
    /* Цвета задаются через inline стили */
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-width: 4px !important;
    border-color: #2196F3 !important;
}

.intensity-btn:active {
    transform: translateY(0);
}

/* Адаптивность для мобильных - intensity selector */
@media (max-width: 600px) {
    .intensity-selector {
        padding: 15px;
    }
    
    .intensity-hint {
        font-size: 13px;
    }
    
    .intensity-title {
        font-size: 14px;
    }
    
    .intensity-buttons {
        gap: 6px;
    }
    
    .intensity-btn {
        min-width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

/* Информационный блок о программе */
.program-info-block {
    margin: 30px 0;
    padding: 25px;
    background-color: #fff9e6;
    border-radius: 8px;
    border: 2px solid #ffc107;
    line-height: 1.8;
}

.program-info-line {
    width: 100%;
    height: 2px;
    background-color: #333;
    margin: 20px 0;
    border: none;
}

.program-info-block p {
    margin: 15px 0;
    font-size: 16px;
    color: #333;
}

.program-warning-title {
    font-weight: bold;
    font-size: 18px;
    color: #d32f2f;
    margin-top: 20px !important;
    margin-bottom: 15px !important;
    text-transform: uppercase;
}

/* Адаптивность для мобильных - информационный блок */
@media (max-width: 600px) {
    .program-info-block {
        padding: 15px;
        margin: 20px 0;
    }
    
    .program-info-block p {
        font-size: 14px;
    }
    
    .program-warning-title {
        font-size: 16px;
    }
}

/* Уведомление об основном чекапе */
.main-checkup-notification {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    border-left: 5px solid #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    animation: slideIn 0.5s ease-out;
}

.main-checkup-notification-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.main-checkup-notification-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.main-checkup-notification-text {
    flex: 1;
    min-width: 200px;
}

.main-checkup-notification-text strong {
    display: block;
    font-size: 18px;
    color: #1565C0;
    margin-bottom: 8px;
}

.main-checkup-notification-text p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.main-checkup-notification-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.main-checkup-notification-btn:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Уведомление о речекапе */
.recheckup-notification {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 12px;
    border-left: 5px solid #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recheckup-notification-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.recheckup-notification-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.recheckup-notification-text {
    flex: 1;
    min-width: 200px;
}

.recheckup-notification-text strong {
    display: block;
    font-size: 18px;
    color: #2e7d32;
    margin-bottom: 8px;
}

.recheckup-notification-text p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.recheckup-notification-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.recheckup-notification-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Адаптивность для уведомления об основном чекапе */
@media (max-width: 600px) {
    .main-checkup-notification {
        padding: 15px;
    }

    .main-checkup-notification-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .main-checkup-notification-icon {
        font-size: 36px;
    }

    .main-checkup-notification-text strong {
        font-size: 16px;
    }

    .main-checkup-notification-text p {
        font-size: 13px;
    }

    .main-checkup-notification-btn {
        width: 100%;
        text-align: center;
    }
}

/* Адаптивность для уведомления о речекапе */
@media (max-width: 600px) {
    .recheckup-notification {
        padding: 15px;
    }

    .recheckup-notification-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .recheckup-notification-icon {
        font-size: 36px;
    }

    .recheckup-notification-text strong {
        font-size: 16px;
    }

    .recheckup-notification-text p {
        font-size: 13px;
    }

    .recheckup-notification-btn {
        width: 100%;
        text-align: center;
    }

    .program-warning-title {
        font-size: 14px;
    }
}

/* ========================================
   СТИЛИ ДЛЯ РЕЧЕКАПА (ПРОМЕЖУТОЧНОГО ЧЕКАПА)
   ======================================== */

/* Информационный блок */
.intro-section {
    margin-bottom: 30px;
    text-align: center;
}

.intro-section h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.intro-text {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* Секция симптомов */
.symptoms-section {
    margin-top: 20px;
}

.symptoms-list {
    margin-bottom: 30px;
}

/* Карточка симптома */
.symptom-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    transition: box-shadow 0.3s ease;
}

.symptom-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.symptom-header {
    margin-bottom: 20px;
}

.symptom-header h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.base-intensity-info {
    font-size: 16px;
    color: #555;
    margin: 12px 0 0 0;
    padding: 0;
    text-align: center;
    display: block;
}

.base-intensity-info strong {
    color: #333;
    font-weight: 600;
}

/* Контейнер слайдера */
.symptom-slider-container {
    margin-top: 15px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.slider-label-left,
.slider-label-right {
    flex: 1;
}

.slider-label-right {
    text-align: right;
}

/* Слайдер оценки */
.symptom-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    margin: 15px 0;
}

.symptom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.symptom-slider::-webkit-slider-thumb:hover {
    background: #45a049;
}

.symptom-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.symptom-slider::-moz-range-thumb:hover {
    background: #45a049;
}

/* Отображение значения слайдера */
.slider-value-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.slider-value {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    min-width: 40px;
    text-align: center;
}

.slider-interpretation {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Блоки результатов речекапа */
.health-index-block {
    background-color: #f0f8f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #4CAF50;
}

.health-index-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.health-index-comparison {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 18px;
}

.health-index-before,
.health-index-after {
    font-weight: bold;
    color: #333;
}

.health-index-arrow {
    font-size: 24px;
    color: #666;
}

.health-index-delta {
    font-weight: bold;
    font-size: 20px;
    padding: 5px 10px;
    border-radius: 4px;
}

.health-index-delta.positive {
    color: #27AE60;
    background-color: #d5f4e6;
}

.health-index-delta.negative {
    color: #E74C3C;
    background-color: #fadbd8;
}

/* Динамика по системам */
.systems-improvement-block {
    margin-bottom: 25px;
}

.systems-improvement-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.systems-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.system-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.system-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.system-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.progress-bar-small {
    flex: 1;
    min-width: 200px;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.system-improvement {
    font-weight: bold;
    color: #333;
    min-width: 50px;
}

.system-delta {
    font-size: 14px;
    padding: 3px 8px;
    border-radius: 4px;
}

.system-delta.positive {
    color: #27AE60;
    background-color: #d5f4e6;
}

.system-delta.negative {
    color: #E74C3C;
    background-color: #fadbd8;
}

/* Лучшие улучшения */
.top-improvements-block {
    margin-bottom: 25px;
}

.top-improvements-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.top-improvements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-improvements-list li {
    background-color: #f9f9f9;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
    font-size: 15px;
    line-height: 1.5;
}

/* Симптомы требующие внимания */
.needs-attention-block {
    margin-bottom: 25px;
}

.needs-attention-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.needs-attention-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.needs-attention-list li {
    background-color: #fff3cd;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    font-size: 15px;
    line-height: 1.5;
}

/* Мотивационный блок */
.motivation-block {
    background-color: #e8f5e9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #4CAF50;
}

.motivation-block h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.motivation-block p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* Блок поздравления */
.congratulations-block {
    text-align: center;
    padding: 40px 20px;
    background-color: #e8f5e9;
    border-radius: 8px;
    border: 2px solid #4CAF50;
}

.congratulations-block h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 28px;
}

.congratulations-block p {
    font-size: 18px;
    color: #333;
    line-height: 1.6;
}

/* История речекапов */
.history-item {
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Карточка основного чекапа */
.history-item.checkup-card {
    background-color: #f9f9f9;
    border-left: 4px solid #2196F3;
    margin-bottom: 10px;
}

/* Вложенная карточка речекапа */
.history-item.recheckup-card.nested {
    margin-left: 30px;
    margin-top: -5px;
    margin-bottom: 15px;
    background-color: #e8f5e9;
    border-left: 4px solid #4CAF50;
    position: relative;
}

/* Индикатор вложенности */
.recheckup-indicator {
    position: absolute;
    left: -30px;
    top: 20px;
    font-size: 20px;
    color: #999;
}

/* Дельта показателей */
.stat-change.positive {
    color: #4CAF50;
    font-weight: bold;
}

.stat-change.negative {
    color: #F44336;
    font-weight: bold;
}

.history-date {
    font-size: 16px;
    color: #333;
}

.history-delta {
    font-weight: bold;
    font-size: 18px;
    color: #4CAF50;
}

.history-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.history-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.recheckup-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-improvement {
    font-size: 14px;
    color: #666;
}

/* Адаптивность для мобильных - речекап */
@media (max-width: 600px) {
    .intro-section h2 {
        font-size: 24px;
    }

    .intro-text {
        font-size: 14px;
    }

    .symptom-card {
        padding: 15px;
    }

    .symptom-header h3 {
        font-size: 16px;
    }

    .slider-labels {
        font-size: 11px;
    }

    .slider-value {
        font-size: 20px;
    }

    .slider-interpretation {
        font-size: 12px;
    }

    .health-index-comparison {
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .health-index-arrow {
        display: none;
    }

    .system-progress {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-bar-small {
        width: 100%;
        min-width: 100%;
    }
}

/* ============================================
   RECHECKUP RESULTS - РАСШИРЕННЫЕ СТИЛИ
   ============================================ */

/* Мотивационный блок */
.recheckup-motivation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.motivation-icon {
    font-size: 48px;
    line-height: 1;
}

.motivation-content {
    flex: 1;
}

.motivation-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.motivation-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.95;
    color: white;
}

/* Секции результатов */
.recheckup-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.recheckup-section h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.recheckup-section h4 {
    margin: 12px 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

/* Индекс здоровья */
.recheckup-health-index .health-index-change {
    font-size: 28px;
    font-weight: 700;
    margin: 12px 0;
}

.recheckup-health-index .delta {
    color: #28a745;
    font-size: 24px;
}

.recheckup-health-index .health-index-change.negative .delta {
    color: #dc3545;
}

.recheckup-health-index .average-improvement {
    font-size: 16px;
    color: #666;
    margin: 8px 0 0 0;
}

/* Блок статистики улучшений с прогресс-баром */
.recheckup-improvement-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.recheckup-improvement-stats h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.recheckup-improvement-stats .stats-total {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

/* Контейнер прогресс-бара */
.improvement-progress-bar {
    width: 100%;
    height: 32px;
    background: #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Сегменты прогресс-бара */
.progress-segment {
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-segment.segment-resolved {
    background: #8B5CF6;
}

.progress-segment.segment-much-better {
    background: #10B981;
}

.progress-segment.segment-better {
    background: #84CC16;
}

.progress-segment.segment-unchanged {
    background: #F59E0B;
}

.progress-segment.segment-worse {
    background: #EF4444;
}

/* Легенда */
.improvement-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.legend-item .legend-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-item .legend-text {
    flex: 1;
}

.legend-item .legend-count {
    font-weight: 600;
    color: #666;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .recheckup-improvement-stats {
        padding: 16px;
    }
    
    .improvement-progress-bar {
        height: 24px;
    }
    
    .progress-segment {
        font-size: 8px;
    }
    
    .legend-item {
        font-size: 13px;
    }
}

/* Динамика по системам */
.system-item {
    margin-bottom: 16px;
}

.system-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.system-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-container {
    flex: 1;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 12px;
    transition: width 0.6s ease;
}

.system-stats {
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
    white-space: nowrap;
}

.systems-improved {
    margin-bottom: 16px;
}

.system-item.improved {
    background-color: #f0f9f4;
    border-left: 4px solid #28a745;
}

.systems-worsened {
    margin-top: 16px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}

.system-item.worsened {
    background-color: #fef2f2;
    border-left: 4px solid #dc3545;
}

.system-item.worsened .system-stats {
    color: #dc3545;
}

.systems-unchanged {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}

.systems-unchanged ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.systems-unchanged li {
    color: #666;
    margin-bottom: 4px;
}

/* Топ улучшений */
.improvements-list {
    list-style: none;
    counter-reset: improvements-counter;
    padding: 0;
    margin: 0;
}

.improvements-list li {
    counter-increment: improvements-counter;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.improvements-list li::before {
    content: counter(improvements-counter) ". ";
    font-weight: 700;
    color: #667eea;
    margin-right: 8px;
}

.symptom-text {
    flex: 1;
    color: #333;
}

.symptom-score {
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    margin-left: 12px;
}

.improvement-high {
    background: #d4edda;
    color: #155724;
}

.improvement-low {
    background: #f8d7da;
    color: #721c24;
}

/* Требует внимания */
.attention-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attention-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.attention-label {
    font-size: 13px;
    color: #856404;
    margin-left: 8px;
    font-style: italic;
}

/* Адаптивность для мобильных - результаты речекапа */
@media (max-width: 600px) {
    .recheckup-motivation {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .motivation-icon {
        font-size: 36px;
    }

    .motivation-title {
        font-size: 20px;
    }

    .motivation-text {
        font-size: 14px;
    }

    .recheckup-section {
        padding: 16px;
    }

    .recheckup-section h3 {
        font-size: 18px;
    }

    .recheckup-health-index .health-index-change {
        font-size: 22px;
    }

    .recheckup-health-index .delta {
        font-size: 18px;
    }

    .system-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .progress-bar-container {
        width: 100%;
    }

    .system-stats {
        font-size: 12px;
    }

    .improvements-list li,
    .attention-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .symptom-score {
        margin-left: 0;
    }
}

/* Блок оценки улучшения симптома */
.improvement-level-block {
    background-color: #f0f9f4;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #4caf50;
}

.improvement-hint {
    font-size: 16px;
    font-weight: 600;
    color: #4caf50;
    margin-bottom: 12px;
}

.improvement-description {
    font-size: 13px;
    font-weight: normal;
    color: #555;
}

.improvement-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.improvement-btn {
    min-width: 45px;
    height: 45px;
    padding: 10px;
    /* background-color и border-color задаются через inline стили */
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.improvement-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.improvement-btn.selected {
    /* Цвета задаются через inline стили */
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-width: 4px !important;
    border-color: #2196F3 !important;
}

.improvement-btn:active {
    transform: translateY(0);
}

/* Адаптивность для мобильных - improvement level block */
@media (max-width: 600px) {
    .improvement-level-block {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .improvement-hint {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .improvement-description {
        font-size: 12px;
    }
    
    .improvement-buttons {
        gap: 6px;
    }
    
    .improvement-btn {
        min-width: 38px;
        height: 38px;
        font-size: 14px;
    }
}




/* Аналитические вопросы */
.analytics-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.analytics-intro {
    margin-bottom: 30px;
    color: #666;
    font-size: 16px;
}

.analytics-question {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.analytics-question h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.analytics-hint {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.analytics-answer {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #e8f5e9;
    border-radius: 4px;
    color: #2e7d32;
    font-size: 14px;
}

.analytics-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.analytics-btn {
    padding: 12px 20px;
    border: 2px solid #4CAF50;
    background-color: #fff;
    color: #4CAF50;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.analytics-btn:hover {
    background-color: #f1f8f4;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.analytics-btn.selected {
    background-color: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.analytics-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.analytics-actions {
    margin-top: 30px;
    text-align: center;
}

.analytics-actions .btn {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .analytics-container {
        padding: 15px;
    }

    .analytics-question {
        padding: 15px;
    }

    .analytics-buttons {
        flex-direction: column;
    }

    .analytics-btn {
        width: 100%;
    }
}

/* ===========================================
   SPLIT METRICS - Разделенные метрики
   Блоки для честного отображения прогресса:
   1. Целевые системы
   2. Остальные системы
   3. Общий индекс здоровья
=========================================== */

.split-metrics-container {
    margin-bottom: 30px;
}

.split-metrics-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.split-metrics-section .section-header {
    margin-bottom: 15px;
}

.split-metrics-section .section-header h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #333;
}

.split-metrics-section .section-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.split-metrics-section .section-note {
    font-size: 13px;
    color: #888;
    margin: 10px 0 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #ddd;
}

/* Блок 1: Целевые системы */
.target-systems-section {
    border-left: 4px solid #4CAF50;
}

.target-progress-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.target-progress-summary.positive {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.target-progress-summary.negative {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.target-progress-summary .progress-icon {
    font-size: 32px;
}

.target-progress-summary .progress-text {
    flex: 1;
}

.target-progress-summary .progress-text strong {
    display: block;
    font-size: 16px;
    color: #333;
}

.target-progress-summary .progress-details {
    font-size: 13px;
    color: #666;
}

.target-motivation {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.target-motivation.positive {
    background: #e8f5e9;
    border-left: 3px solid #4CAF50;
    color: #2e7d32;
}

.target-motivation.neutral {
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    color: #e65100;
}

.target-motivation.attention {
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    color: #f57c00;
}

.target-motivation p {
    margin: 0;
    font-size: 14px;
}

/* Блок 2: Остальные системы */
.other-systems-section {
    border-left: 4px solid #2196F3;
}

/* Общие стили для списка систем */
.systems-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.systems-list .system-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.systems-list .system-item:hover {
    background: #f0f0f0;
}

.systems-list .system-item.positive {
    border-left: 3px solid #4CAF50;
}

.systems-list .system-item.negative {
    border-left: 3px solid #f44336;
}

.systems-list .system-item.no-data {
    border-left: 3px solid #9e9e9e;
}

.systems-list .system-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.systems-list .system-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.systems-list .progress-bar-mini {
    width: 60px;
    height: 6px;
    background: #4CAF50;
    border-radius: 3px;
    max-width: 60px;
}

.systems-list .system-item.negative .progress-bar-mini {
    background: #f44336;
}

.systems-list .system-item.no-data .progress-bar-mini {
    background: #9e9e9e;
}

.systems-list .system-stats {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    min-width: 80px;
    text-align: right;
}

.systems-list .system-item.positive .system-stats {
    color: #4CAF50;
}

.systems-list .system-item.negative .system-stats {
    color: #f44336;
}

/* Блок 3: Общий индекс здоровья */
.overall-health-section {
    border-left: 4px solid #9c27b0;
    text-align: center;
}

.health-index-comparison {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.health-index-comparison .index-before,
.health-index-comparison .index-after {
    text-align: center;
}

.health-index-comparison .label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.health-index-comparison .value {
    display: block;
    font-size: 28px;
    font-weight: 700;
}

.health-index-comparison .index-before .value {
    color: #666;
}

.health-index-comparison .index-after .value {
    color: #333;
}

.health-index-comparison .index-arrow {
    font-size: 24px;
    color: #999;
}

.health-index-comparison .index-delta {
    font-size: 18px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
}

.health-index-comparison .index-delta.positive {
    background: #e8f5e9;
    color: #4CAF50;
}

.health-index-comparison .index-delta.negative {
    background: #ffebee;
    color: #f44336;
}

.health-index-comparison .index-delta.no-data {
    background: #f5f5f5;
    color: #9e9e9e;
}

.health-index-single {
    padding: 30px;
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border-radius: 12px;
    margin-bottom: 15px;
}

.health-index-single .value {
    font-size: 48px;
    font-weight: 700;
    color: #7b1fa2;
    display: block;
    margin-bottom: 10px;
}

.health-index-single .first-checkup-note {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.overall-explanation {
    font-size: 13px;
    color: #888;
    margin: 15px 0 0 0;
    padding: 10px;
    background: #fafafa;
    border-radius: 8px;
    text-align: left;
}

/* Адаптивные стили */
@media (max-width: 600px) {
    .split-metrics-section {
        padding: 15px;
    }

    .target-progress-summary {
        flex-direction: column;
        text-align: center;
    }

    .health-index-comparison {
        flex-direction: column;
        gap: 10px;
    }

    .health-index-comparison .index-arrow {
        transform: rotate(90deg);
    }

    .systems-list .system-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .systems-list .system-progress {
        width: 100%;
        justify-content: space-between;
    }

    .systems-list .progress-bar-mini {
        flex: 1;
        max-width: none;
    }
}
