/* tests/css/suburi.css */
:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --primary-color: var(--tg-theme-button-color, #3390ec);
    --primary-text-color: var(--tg-theme-button-text-color, white);
    --background-color: var(--tg-theme-bg-color, white);
    --secondary-bg-color: var(--tg-theme-secondary-bg-color, #f0f2f5);
    --text-color: var(--tg-theme-text-color, #333);
    --hint-color: var(--tg-theme-hint-color, #8e8e93);
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --border-color: var(--secondary-bg-color);
}

/* Общие стили и утилиты */
.hidden {
    display: none !important;
}

.back-link {
    margin-bottom: 15px;
}

.back-link a {
    display: flex;
    align-items: center;
    color: var(--tg-theme-link-color, #2481cc);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-link svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Контейнер и описание */
.suburi-container {
    margin-bottom: 30px;
}

.suburi-description {
    margin-bottom: 20px;
    color: var(--hint-color);
    font-size: 14px;
}

/* Прогресс бар */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    height: 8px;
    background-color: var(--secondary-bg-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

/* Содержимое теста */
.test-content {
    background-color: var(--secondary-bg-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.question-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-color);
    padding: 10px;
    background-color: var(--background-color);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* Кнопка проверки */
.check-button {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.check-button:hover {
    opacity: 0.9;
}

.check-button:active {
    transform: translateY(1px);
}

.check-button.ready {
    opacity: 1;
}

/* Стили для выбора раздела */
.section-select-container {
    background-color: var(--secondary-bg-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.section-select-container h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: center;
}

.section-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-button {
    background-color: var(--background-color);
    border: 2px solid var(--secondary-bg-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.section-button:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.section-button.selected {
    border-color: var(--primary-color);
    background-color: rgba(51, 144, 236, 0.1);
}

.section-button.completed {
    border-color: var(--success-color);
}

.section-button.completed.selected {
    border-color: var(--primary-color);
}

.section-button.locked {
    background-color: var(--secondary-bg-color);
    cursor: not-allowed;
    opacity: 0.7;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.section-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    margin-right: 10px;
}

.section-name {
    font-weight: 600;
    color: var(--text-color);
}

.section-description {
    font-size: 13px;
    color: var(--hint-color);
    margin-top: 5px;
}

.section-rewards {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.section-reward {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.section-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background-color: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Стили для сопоставления */
.matching-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.numbers-column {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.techniques-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.number-item {
    width: 50px;
    height: 50px;
    min-height: auto;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    background-color: var(--background-color);
    border: 2px solid var(--secondary-bg-color);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-item:hover {
    border-color: var(--primary-color);
}

.number-item.selected {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    border-color: var(--primary-color);
    animation: pulse 0.3s ease;
}

.number-item.matched {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
    cursor: default;
}

.technique-item {
    position: relative;
    padding: 12px 15px 12px 60px;
    margin-bottom: 5px;
    border-radius: var(--radius-md);
    background-color: var(--background-color);
    border: 2px solid var(--secondary-bg-color);
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.technique-item:hover {
    border-color: var(--primary-color);
}

.technique-item.matched {
    opacity: 0.5;
    cursor: default;
}

.technique-item.active {
    animation: pulse 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.number-selector {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-selector:hover {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
}

.number-selector.matched {
    background-color: var(--success-color);
    color: white;
}

.technique-text-container {
    flex: 1;
}

.technique-text {
    line-height: 1.3;
    padding-right: 10px;
}

.video-button {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.video-button:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Номерной выбор */
.number-picker {
    position: absolute;
    z-index: 100;
    background-color: var(--background-color);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 220px;
}

.number-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-option:hover {
    background-color: var(--primary-color);
    color: var(--primary-text-color);
}

.number-picker-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--error-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Текущие сопоставления */
.current-matches {
    background-color: var(--secondary-bg-color);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 20px;
}

.matches-title {
    font-weight: 500;
    margin-bottom: 10px;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.match-item {
    display: flex;
    align-items: center;
    background-color: var(--background-color);
    padding: 10px;
    border-radius: var(--radius-sm);
}

.match-number {
    font-weight: bold;
    margin-right: 10px;
    min-width: 25px;
}

.match-technique {
    flex: 1;
}

.remove-match-button {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
}

/* Модальные окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
}

#resultModal {
    backdrop-filter: blur(3px);
}

.modal-wrapper {
    background-color: var(--background-color);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 450px;
    margin: 20px;
    position: relative;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--secondary-bg-color);
    position: relative;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.modal-content {
    padding: 20px;
		overflow-y:visible;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--secondary-bg-color);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Результаты */
.modal-wrapper.result-modal {
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    padding: 20px 10px;
}

.result-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.result-icon.success {
    background-color: var(--success-color);
}

.result-icon.failure {
    background-color: var(--error-color);
}

.result-message {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 10px;
    padding: 0 15px;
}

.result-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.result-score {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: var(--secondary-bg-color);
    border-radius: var(--radius-sm);
}

.result-rewards {
    display: flex;
    justify-content: space-around;
}

.reward {
    display: flex;
    align-items: center;
    gap: 5px;
}

.reward-icon {
    font-size: 20px;
}

.reward-value {
    font-weight: 500;
}

/* Неправильные ответы */
.wrong-answers-container {
    width: 100%;
    margin-top: 20px;
    border-top: 1px solid var(--secondary-bg-color);
    padding-top: 20px;
}

.wrong-answers-container h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    display: flex;
    align-items: center;
}

.wrong-answers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.wrong-answer-item {
    background: var(--secondary-bg-color);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 10px;
}

.wrong-question-text {
    font-weight: 500;
    margin-bottom: 10px;
}

.wrong-answer-detail {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wrong-answer-text, .correct-answer-text {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.wrong-answer-text {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.correct-answer-text {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
}

.answer-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
    margin-bottom: -3px;
}

/* Кнопки */
.primary-button, .secondary-button {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
}

.secondary-button {
    background-color: var(--secondary-bg-color);
    color: var(--text-color);
}

#nextSectionButton {
    background-color: var(--success-color);
    color: white;
}

#retryButton {
    background-color: var(--error-color);
    color: white;
    width: 100%;
    font-weight: bold;
}

/* Видео модальное окно */
.video-modal {
    max-width: 95%;
    width: 480px;
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.video-modal .modal-header {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-modal .modal-title {
    color: white;
    margin: 0;
    font-size: 16px;
    max-width: 80%;
    text-align: left;
}

.video-controls-top {
    display: flex;
    align-items: center;
}

.control-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    margin: 0 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.control-button.active {
    color: var(--primary-color);
}

.video-modal .modal-content {
    padding: 0;
}

.video-container {
    position: relative;
    width: 100%;
    background-color: #000;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.video-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
}

/* Вспомогательные функции блокировки прокрутки */
body.no-scroll {
    overflow: hidden;
}

/* Анимации */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* Стили для информации о видео */
.video-info {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.video-info-section, .video-info-technique {
    margin-bottom: 10px;
}

.video-info-section span, .video-info-technique span {
    color: rgba(255, 255, 255, 0.7);
    margin-right: 5px;
}

#backToTestButton {
    margin-top: 10px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#backToTestButton:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
/* Стили для группировки номеров по разделам */
.number-section-header {
    font-size: 14px;
    font-weight: 500;
    color: var(--hint-color);
    margin-top: 10px;
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
    background-color: var(--secondary-bg-color);
    padding: 5px;
    border-radius: var(--radius-sm);
}

.number-section-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    margin-bottom: 10px;
}



.number-picker .number-section-header:first-child {
    margin-top: 0;
}
.technique-item.selected {
    border-color: var(--primary-color);
    background-color: rgba(51, 144, 236, 0.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}
/* Стили для контейнера номера и крестика */
.selector-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}



.technique-item:hover {
    opacity: 1;
}

.remove-match:hover {
    transform: scale(1.2);
}
/* Стили для контейнера номера и крестика */
.selector-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
}


/* Стили для крестика удаления - всегда видимый и заметный */
.remove-match {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #e74c3c !important;
    color: white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important; 
    z-index: 100 !important;
    border: 2px solid white !important;
}

.remove-match:active {
    transform: scale(1.2) !important;
}
/* Стиль для сообщения о том, что нет доступных номеров */
.no-numbers-message {
    padding: 15px;
    text-align: center;
    color: var(--hint-color);
    font-size: 14px;
    background-color: var(--secondary-bg-color);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

/* Стиль для кнопки отмены текущего сопоставления */
.cancel-current-button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.cancel-current-button:hover {
    opacity: 0.9;
}

.cancel-current-button:active {
    transform: translateY(1px);
}
#returnToTestsButton {
    display: block;
    width: 100%;
    margin-top: 10px;
    background-color: var(--hint-color);
    color: white;
}

/* Стили для лидербордов по разделам */
.level-leaderboards {
    margin-top: 30px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.level-leaderboards h3 {
    margin: 0 0 20px 0;
    text-align: center;
    color: var(--text-color);
}

.level-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.level-tab {
    padding: 8px 15px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

.level-tab:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.level-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.level-leaderboard-content {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.level-leaderboard-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.level-leaderboard-item:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

.level-position {
    width: 30px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-right: 15px;
}

.level-position:first-child { color: #FFD700; }
.level-leaderboard-item:nth-child(2) .level-position { color: #C0C0C0; }
.level-leaderboard-item:nth-child(3) .level-position { color: #CD7F32; }

.level-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.level-time {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-color);
    margin-left: 10px;
}

.level-no-data {
    text-align: center;
    color: var(--hint-color);
    padding: 30px;
    font-style: italic;
}

.loading {
    text-align: center;
    color: var(--hint-color);
    padding: 20px;
    font-style: italic;
}

@media (max-width: 480px) {
    .level-tabs {
        gap: 3px;
    }

    .level-tab {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 50px;
    }

    .level-leaderboard-item {
        padding: 8px;
        margin-bottom: 6px;
    }

    .level-position {
        width: 25px;
        font-size: 14px;
        margin-right: 10px;
    }

    .level-time {
        font-size: 12px;
        margin-left: 5px;
    }
}