/* Основные стили FFICD */
.fficd-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

/* Стартовый экран */
.fficd-start-screen {
    padding: 30px;
}

.fficd-start-screen h1 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 28px;
    text-align: center;
    border-bottom: 3px solid #3498db;
    padding-bottom: 15px;
}

.fficd-instructions {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.fficd-instructions p {
    margin: 0 0 15px 0;
    color: #444;
    line-height: 1.6;
}

.fficd-answer-scale {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.fficd-answer-scale p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #2c3e50;
}

.fficd-answer-scale ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.fficd-answer-scale li {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

.fficd-answer-scale li:last-child {
    border-bottom: none;
}

.fficd-answer-scale strong {
    display: inline-block;
    width: 25px;
    color: #3498db;
    font-weight: 600;
}

/* Заголовок теста */
.fficd-test-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.fficd-test-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.fficd-user-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.fficd-info-label {
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.fficd-info-value {
    color: #3498db;
    font-weight: 500;
    margin-right: 15px;
}

.fficd-progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fficd-progress-text {
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.fficd-progress-counter {
    background: #3498db;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Прогресс-бар */
.fficd-progress-bar-container {
    margin-top: 10px;
}

.fficd-progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.fficd-progress-fill {
    height: 100%;
    background: #3498db;
    border-radius: 5px;
    width: 0%;
    transition: width 0.5s ease;
}

/* Контейнер вопросов */
.fficd-questions-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

/* Вопросы */
.fficd-question {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.fficd-question:hover {
    border-color: #bdc3c7;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.fficd-question.answered {
    border-color: #2ecc71;
    background-color: #f9fdf9;
}

.fficd-question-header {
    margin-bottom: 20px;
}

.fficd-question-title {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}

.fficd-question-number {
    background: #3498db;
    color: white;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

/* Для трехзначных номеров */
.fficd-question-number[data-number^="1"],
.fficd-question-number[data-number^="2"],
.fficd-question-number[data-number^="3"],
.fficd-question-number[data-number^="4"],
.fficd-question-number[data-number^="5"],
.fficd-question-number[data-number^="6"],
.fficd-question-number[data-number^="7"],
.fficd-question-number[data-number^="8"],
.fficd-question-number[data-number^="9"] {
    min-width: 40px;
}

.fficd-question-number[data-number="100"],
.fficd-question-number[data-number="101"],
.fficd-question-number[data-number="102"],
.fficd-question-number[data-number="103"],
.fficd-question-number[data-number="104"],
.fficd-question-number[data-number="105"],
.fficd-question-number[data-number="106"],
.fficd-question-number[data-number="107"],
.fficd-question-number[data-number="108"],
.fficd-question-number[data-number="109"],
.fficd-question-number[data-number="110"],
.fficd-question-number[data-number="111"],
.fficd-question-number[data-number="112"],
.fficd-question-number[data-number="113"],
.fficd-question-number[data-number="114"],
.fficd-question-number[data-number="115"],
.fficd-question-number[data-number="116"],
.fficd-question-number[data-number="117"],
.fficd-question-number[data-number="118"],
.fficd-question-number[data-number="119"],
.fficd-question-number[data-number="120"],
.fficd-question-number[data-number="121"] {
    min-width: 46px;
    font-size: 15px;
}

.fficd-question-text {
    flex: 1;
    font-size: 17px;
    line-height: 1.5;
    color: #2c3e50;
    font-weight: 500;
}

/* Варианты ответов */
.fficd-question-options {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.fficd-options-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.fficd-option-item {
    position: relative;
}

.fficd-option-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.fficd-option-label {
    padding: 15px 10px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    color: #555;
    height: 100%;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fficd-option-label:hover {
    border-color: #3498db;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.fficd-option-item input[type="radio"]:checked + .fficd-option-label {
    background: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.fficd-option-number {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.fficd-option-text {
    font-size: 12px;
    line-height: 1.3;
    max-width: 100%;
    word-wrap: break-word;
}

/* Кнопки */
#fficd-start-button,
.fficd-next-btn,
.fficd-prev-btn,
.fficd-submit-btn,
.fficd-pdf-btn,
.fficd-retake-btn {
    display: inline-block;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    margin: 10px 5px;
    min-width: 120px;
}

#fficd-start-button {
    background: #3498db;
    color: white;
    font-size: 18px;
    padding: 16px 40px;
    margin: 30px auto;
    display: block;
    width: 100%;
    max-width: 300px;
}

#fficd-start-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.fficd-next-btn {
    background: #2ecc71;
    color: white;
}

.fficd-next-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.fficd-prev-btn {
    background: #95a5a6;
    color: white;
}

.fficd-prev-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.fficd-submit-btn {
    background: #3498db;
    color: white;
}

.fficd-submit-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.fficd-pdf-btn {
    background: #e74c3c;
    color: white;
}

.fficd-pdf-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.fficd-retake-btn {
    background: #95a5a6;
    color: white;
}

.fficd-retake-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

/* Навигация */
.fficd-navigation {
    display: flex;
    justify-content: space-between;
    padding: 25px 0;
    margin-top: 20px;
    border-top: 1px solid #eee;
}

.fficd-nav-arrow {
    font-weight: bold;
    margin: 0 5px;
}

/* Сохранение прогресса */
.fficd-save-notice {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    color: #1565c0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fficd-save-icon {
    font-size: 16px;
}

/* Результаты */
.fficd-results-header {
    background: #e3f2fd;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #bbdefb;
}

.fficd-results-header h1 {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #0d47a1;
    text-align: center;
}

.fficd-user-results-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px solid #bbdefb;
}

.fficd-user-results-info p {
    margin: 10px 0;
    font-size: 15px;
}

.fficd-user-results-info strong {
    color: #444;
    margin-right: 10px;
}

/* Таблица результатов */
.fficd-results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fficd-results-table th {
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.fficd-results-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.fficd-results-table tr:nth-child(even) {
    background: #f8f9fa;
}

.fficd-results-table tr:hover {
    background: #f0f7ff;
}

.fficd-domain-name {
    font-weight: 600;
    color: #2c3e50;
}

.fficd-domain-score {
    font-weight: bold;
    font-size: 18px;
    color: #3498db;
}

.fficd-progress-cell {
    min-width: 150px;
}

.fficd-mini-progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.fficd-mini-progress-fill {
    height: 100%;
    background: #3498db;
    border-radius: 4px;
}

/* Интерпретация результатов */
.fficd-interpretation {
    background: #fff9e6;
    border-radius: 10px;
    padding: 25px;
    margin: 30px 0;
    border: 2px solid #ffd54f;
}

.fficd-interpretation h2 {
    color: #5d4037;
    margin: 0 0 20px 0;
    font-size: 22px;
    border-bottom: 2px solid #ffa000;
    padding-bottom: 10px;
}

.fficd-interpretation-content p {
    margin: 0 0 15px 0;
    color: #5d4037;
    line-height: 1.6;
}

/* Кнопки действий */
.fficd-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .fficd-options-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .fficd-option-label {
        min-height: 80px;
        padding: 10px 5px;
    }
    
    .fficd-option-text {
        font-size: 11px;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .fficd-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .fficd-option-label {
        min-height: 70px;
        padding: 8px 4px;
    }
    
    .fficd-option-number {
        font-size: 16px;
    }
    
    .fficd-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .fficd-next-btn,
    .fficd-prev-btn,
    .fficd-submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .fficd-options-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .fficd-option-label {
        min-height: auto;
        padding: 10px;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .fficd-option-number {
        margin-bottom: 0;
        font-size: 14px;
        min-width: 24px;
        text-align: center;
    }
    
    .fficd-option-text {
        font-size: 12px;
        text-align: left;
    }
    
    .fficd-question-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .fficd-question-number {
        align-self: flex-start;
    }
}/* Спиннер загрузки */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Табы */
.fficd-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin: 20px 0;
    flex-wrap: wrap;
}

.fficd-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.fficd-tab-btn:hover {
    color: #3498db;
}

.fficd-tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.fficd-tab-content {
    display: none;
}

.fficd-tab-content.active {
    display: block;
}

/* Стили для групп субдоменов и нюансов */
.fficd-subdomain-group,
.fficd-nuance-group {
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.fficd-subdomain-group h4,
.fficd-nuance-group h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Таблицы субдоменов и нюансов */
.fficd-subdomain-table,
.fficd-nuance-table {
    font-size: 14px;
}

.fficd-subdomain-table th,
.fficd-nuance-table th {
    background: #4a5568;
    padding: 12px;
}

.fficd-subdomain-table td,
.fficd-nuance-table td {
    padding: 12px;
}

.fficd-domain-average,
.fficd-subdomain-average,
.fficd-nuance-average {
    font-weight: bold;
    font-size: 16px;
    text-align: center;
}

.fficd-domain-score,
.fficd-subdomain-score,
.fficd-nuance-score {
    text-align: center;
    color: #666;
}

/* Цветовая маркировка по уровням */
.fficd-domain-row.high td:first-child,
.fficd-subdomain-row.high td:first-child,
.fficd-nuance-row.high td:first-child {
    border-left: 4px solid #e74c3c;
}

.fficd-domain-row.medium td:first-child,
.fficd-subdomain-row.medium td:first-child,
.fficd-nuance-row.medium td:first-child {
    border-left: 4px solid #f39c12;
}

.fficd-domain-row.low td:first-child,
.fficd-subdomain-row.low td:first-child,
.fficd-nuance-row.low td:first-child {
    border-left: 4px solid #2ecc71;
}

/* Интерпретация */
.fficd-interpretation-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.fficd-interpretation-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Печать */
@media print {
    .fficd-tabs,
    .fficd-actions {
        display: none !important;
    }
    
    .fficd-tab-content {
        display: block !important;
    }
    
    .fficd-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .fficd-tabs {
        flex-direction: column;
    }
    
    .fficd-tab-btn {
        width: 100%;
        text-align: left;
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 5px;
    }
    
    .fficd-tab-btn.active {
        border-left-color: #3498db;
        border-bottom-color: transparent;
    }
    
    .fficd-results-table {
        display: block;
        overflow-x: auto;
    }
}