/* Основные стили */
.ysq-test-container,
.ysq-results-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ysq-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.ysq-header h1 {
    margin: 0;
    font-size: 28px;
}

.ysq-section {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

/* Форма */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #667eea;
    outline: none;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
}

/* Шкала ответов */
.scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.scale-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

/* Вопросы */
.questions-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.question-item {
    padding: 20px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.question-text {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.question-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.answer-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s;
    min-width: 50px;
}

.answer-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.answer-label input[type="radio"] {
    margin-bottom: 5px;
}

.answer-number {
    font-weight: bold;
    color: #495057;
}

/* Кнопки */
.ysq-submit-btn,
.ysq-pdf-btn,
.ysq-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: inline-block;
    margin: 10px;
}

.ysq-submit-btn:hover,
.ysq-pdf-btn:hover,
.ysq-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.submit-section {
    text-align: center;
}

.note {
    margin-top: 10px;
    color: #6c757d;
    font-size: 14px;
}

/* Загрузка */
#ysq-loading {
    text-align: center;
    padding: 30px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Результаты */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.info-grid div {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.scheme-item {
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.scheme-item.expressed {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.scheme-stats {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.stat {
    padding: 8px 15px;
    background: white;
    border-radius: 6px;
    font-weight: 600;
}

.scheme-description {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
    color: #495057;
}

/* Таблица результатов */
.ysq-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.ysq-results-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
}

.ysq-results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.ysq-results-table tr:hover {
    background: #f8f9ff;
}

.ysq-results-table tr.expressed {
    background: #fff3cd;
}

.ysq-results-table tr.expressed:hover {
    background: #ffeaa7;
}

.actions {
    text-align: center;
    margin-top: 30px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .scale-grid {
        grid-template-columns: 1fr;
    }
    
    .question-answers {
        justify-content: center;
    }
    
    .ysq-header h1 {
        font-size: 22px;
    }
    
    .ysq-section {
        padding: 15px;
    }
}

/* Прогресс-бар */
.progress-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#progress-counter {
    font-weight: 600;
    color: #495057;
}

.progress-bar {
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 15px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    min-width: 60px;
}

/* Навигация по вопросам */
.questions-navigation {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.ysq-nav-btn {
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.ysq-nav-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Загрузка вопросов */
.loading-questions {
    text-align: center;
    padding: 40px;
}

.loading-questions .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Прогресс по каждому вопросу */
.question-progress {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dee2e6;
    color: #6c757d;
    font-size: 12px;
}

/* Подсветка текущего вопроса */
.question-item:target {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
    animation: highlight 2s ease;
}

@keyframes highlight {
    0% { background-color: #fff3cd; }
    100% { background-color: #f8f9fa; }
}

/* Адаптивность для прогресс-бара */
@media (max-width: 768px) {
    .questions-navigation {
        bottom: 10px;
        right: 10px;
    }
    
    .ysq-nav-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .progress-container {
        padding: 15px;
    }
}