/* Файл: public/assets/css/kontrol-single.css */
/* Стили для страницы прохождения контрольной точки */

.kontrol-page-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    min-height: 70vh;
}

/* ========== ХЛЕБНЫЕ КРОШКИ ========== */
.kontrol-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #6c757d;
    gap: 4px;
}

.kontrol-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.kontrol-breadcrumb a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.kontrol-breadcrumb .current {
    color: #1a1a2e;
    font-weight: 500;
}

/* ========== ЗАГОЛОВОК ========== */
.kontrol-header {
    margin-bottom: 30px;
}

.kontrol-header .header-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.kontrol-header .tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 15px;
    border-radius: 30px;
    font-size: 0.83rem;
    font-weight: 600;
}

.tag-kontrol {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
}

.tag-questions {
    background: rgba(102,126,234,0.1);
    color: #667eea;
}

.tag-points {
    background: rgba(243,156,18,0.12);
    color: #e67e22;
}

.tag-time {
    background: rgba(52,152,219,0.12);
    color: #3498db;
}

.tag-variant {
    background: rgba(139,92,246,0.15);
    color: #7c3aed;
}

.kontrol-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 12px 0;
    line-height: 1.25;
}

.kontrol-description {
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
    max-width: 800px;
}

/* ========== КАРТОЧКА ========== */
.kontrol-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    border: 1px solid #eef2f6;
    margin-bottom: 30px;
    position: relative;
}

/* ========== ПУСТОЕ СОСТОЯНИЕ ========== */
.empty-content {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-icon i {
    font-size: 34px;
    color: #c1c9d6;
}

.empty-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.empty-content p {
    color: #6c757d;
    margin-bottom: 20px;
}

/* ========== ТАЙМЕР ========== */
.test-timer {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.test-timer.timer-warning {
    background: linear-gradient(135deg, #f56565, #ed8936);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ========== ПРОГРЕСС ========== */
.test-progress {
    margin-bottom: 30px;
}

.test-progress-text {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 8px;
}

.test-progress-bar {
    height: 8px;
    background: #edf2f7;
    border-radius: 10px;
    overflow: hidden;
}

.test-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ========== ВОПРОСЫ ========== */
.test-question {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.question-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.question-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(243,156,18,0.12);
    color: #e67e22;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Бейдж типа вопроса */
.question-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.question-type-badge.qt-text {
    background: rgba(59,130,246,0.12);
    color: #2563eb;
}

.question-type-badge.qt-manual {
    background: rgba(245,158,11,0.18);
    color: #b45309;
    border: 1px solid rgba(245,158,11,0.35);
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ========== ВАРИАНТЫ ОТВЕТОВ (single) ========== */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 2px solid #eef2f6;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.option-item:hover {
    background: white;
    border-color: #667eea;
    transform: translateX(3px);
}

.option-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-letter {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #4a5568;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.option-text {
    font-size: 1rem;
    color: #2c3e50;
    line-height: 1.5;
    font-weight: 500;
}

.option-radio:checked ~ .option-letter {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border-color: #ec4899;
    color: white;
    box-shadow: 0 4px 10px rgba(236,72,153,0.3);
}

.option-radio:checked ~ .option-text {
    color: #1a1a2e;
    font-weight: 600;
}

.option-item:has(.option-radio:checked) {
    background: rgba(236,72,153,0.05);
    border-color: #ec4899;
}

/* ========== ТЕКСТОВЫЙ ОТВЕТ (text / text_manual) ========== */
.question-body {
    margin-bottom: 8px;
}

.text-answer-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.text-answer-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.text-answer-label i {
    color: #667eea;
}

.text-answer-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1a1a2e;
    transition: all 0.2s;
    font-family: inherit;
}

.text-answer-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.12);
}

.text-answer-input::placeholder {
    color: #a0aec0;
}

/* Подсказка про ручную проверку в форме */
.text-answer-wrap .text-muted {
    font-size: 0.85rem;
    color: #718096 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 10px;
    background: rgba(245,158,11,0.08);
    border-left: 3px solid #f59e0b;
    border-radius: 6px;
}

.text-answer-wrap .text-muted i {
    color: #d97706;
}

/* ========== НАВИГАЦИЯ ТЕСТА ========== */
.test-navigation {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px dashed #eef2f6;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-back {
    background: #f8fafc;
    color: #4a5568;
    border: 1px solid #e9ecef;
}

.nav-back:hover:not(:disabled) {
    background: white;
    border-color: #667eea;
    color: #667eea;
    transform: translateX(-3px);
}

.nav-discipline {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-left: auto;
}

.nav-discipline:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
    color: white;
}

.nav-submit {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    margin-left: auto;
}

.nav-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72,187,120,0.35);
    color: white;
}

/* ========== НИЖНЯЯ НАВИГАЦИЯ ========== */
.kontrol-footer-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ==========================================================
   РЕЗУЛЬТАТ
   ========================================================== */
.kontrol-result-card {
    padding: 0;
    overflow: hidden;
}

.result-header {
    text-align: center;
    padding: 50px 30px 40px;
    color: white;
}

.result-header.result-passed {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.result-header.result-failed {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

.result-header.result-manual {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.result-icon {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 3rem;
    backdrop-filter: blur(10px);
}

.result-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.result-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin: 0;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-bottom: 1px solid #eef2f6;
}

.result-stat {
    padding: 25px 20px;
    text-align: center;
    border-right: 1px solid #eef2f6;
}

.result-stat:last-child {
    border-right: none;
}

.result-stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
    margin-bottom: 6px;
}

.result-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Детали по вопросам */
.result-details {
    padding: 30px 40px;
}

.result-details-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 20px 0;
}

.result-detail-item {
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 10px;
    border-left: 4px solid #e2e8f0;
    background: #f8fafc;
}

.result-detail-item.detail-correct {
    border-left-color: #48bb78;
    background: rgba(72,187,120,0.05);
}

.result-detail-item.detail-wrong {
    border-left-color: #f56565;
    background: rgba(245,101,101,0.05);
}

.result-detail-item.detail-manual {
    border-left-color: #f59e0b;
    background: rgba(245,158,11,0.06);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.detail-number {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.detail-status {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.detail-correct .detail-status { color: #38a169; }
.detail-wrong .detail-status { color: #e53e3e; }
.detail-manual .detail-status { color: #d97706; }

.detail-points {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 700;
    color: #4a5568;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.detail-question {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 8px;
}

/* Ответ студента на открытый вопрос */
.detail-student-text {
    font-size: 0.9rem;
    color: #1e40af;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.25);
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    line-height: 1.5;
    word-break: break-word;
}

.detail-student-text i {
    color: #3b82f6;
    flex-shrink: 0;
    margin-top: 3px;
}

.detail-correct-answer {
    font-size: 0.88rem;
    color: #22543d;
    background: rgba(72,187,120,0.1);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Уведомление о ручной проверке (внутри карточки результата) */
.result-manual-notice {
    margin: 20px 40px 0;
    padding: 16px 20px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: 14px;
    color: #92400e;
    font-size: 0.95rem;
    line-height: 1.55;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.result-manual-notice i {
    color: #d97706;
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.result-manual-notice strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    color: #78350f;
}

/* ========== ДЕЙСТВИЯ ========== */
.result-actions {
    padding: 25px 40px 30px;
    border-top: 1px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================================
   БЕЙДЖИ ТИПА ВОПРОСА (используются в других шаблонах)
   ========================================================== */
.qt-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 6px;
}
.qt-single { background: rgba(102,126,234,0.12); color: #667eea; }
.qt-text   { background: rgba(59,130,246,0.12); color: #3b82f6; }
.qt-manual { background: rgba(245,158,11,0.15); color: #d97706; }

/* ==========================================================
   АДАПТИВ
   ========================================================== */
@media (max-width: 768px) {
    .kontrol-title {
        font-size: 1.7rem;
    }

    .kontrol-card {
        padding: 25px 20px;
    }

    .question-text {
        font-size: 1.05rem;
    }

    .option-item {
        padding: 14px 16px;
    }

    .option-letter {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .text-answer-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .test-navigation {
        flex-direction: column-reverse;
    }

    .test-navigation .nav-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0 !important;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-stat {
        border-right: none;
        border-bottom: 1px solid #eef2f6;
    }

    .result-stat:nth-child(odd) {
        border-right: 1px solid #eef2f6;
    }

    .result-stat:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .result-details {
        padding: 20px;
    }

    .result-manual-notice {
        margin: 16px 20px 0;
        padding: 14px 16px;
        font-size: 0.88rem;
    }

    .result-actions {
        padding: 20px;
        flex-direction: column;
    }

    .result-actions .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .kontrol-footer-nav {
        flex-direction: column;
    }

    .kontrol-footer-nav .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .kontrol-breadcrumb {
        font-size: 0.8rem;
    }

    .kontrol-title {
        font-size: 1.4rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .question-header {
        gap: 8px;
    }

    .question-number {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .question-points-badge,
    .question-type-badge {
        font-size: 0.72rem;
        padding: 4px 10px;
    }

    .result-header h2 {
        font-size: 1.4rem;
    }

    .result-stat-value {
        font-size: 1.4rem;
    }

    .detail-student-text {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

/* ==========================================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ (для админки, если подключается)
   ========================================================== */
.answer-cell-text {
    background: rgba(59,130,246,0.08);
    color: #1e40af;
    border: 1px solid rgba(59,130,246,0.3);
}
.answer-cell-text i { color: #3b82f6; }

.manual-score-form { margin-top: 8px; }
.manual-score-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.manual-score-input { width: 80px; }
.manual-score-max { font-size: 0.8rem; color: #718096; }

.question-type-badge-wrap { margin-top: 6px; }
.question-type-single { }
.question-type-text { }
.question-type-text_manual { border-left-color: #f59e0b !important; }

.question-correct-text,
.question-manual-info {
    padding: 10px 14px;
    background: rgba(72,187,120,0.08);
    border: 1px solid rgba(72,187,120,0.25);
    border-radius: 10px;
    font-size: 0.88rem;
    color: #22543d;
    margin-top: 10px;
}
.question-manual-info {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.3);
    color: #744210;
}

.detail-manual {
    border-left-color: #f59e0b !important;
    background: rgba(245,158,11,0.05) !important;
}
.detail-manual .detail-status { color: #d97706; }