.support-footer {
    margin: 32px auto 16px;
    padding: 0 16px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

.support-footer a {
    color: #9abddd;
    text-underline-offset: 3px;
}

.support-footer a:hover {
    color: #c7deef;
}

body {
    font-family: Nunito, sans-serif;
  background-color: rgb(10, 25, 41);
  --ck-color-base-border: #0A1929;

  color: rgb(255, 255, 255);
   
}

header {
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 1201;
    height: 96px;
    background-color: rgba(10, 25, 41, 0.1);
    backdrop-filter: blur(10px);
    
    line-height: 48px;
    box-sizing: border-box;
    padding-left: 24px;
    padding-right: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help img {
    height: 80%;
    width: 80%;
    position: absolute;
    left: 28%;
    top: 10%;
}

.fa-question-circle {
    color: #fff;
    transform: scale(2);
    position: absolute;
    left: 25%;
    top: 25%;
}

.help {
    background-color: #0A1929;
    border-radius: 50%;
    height: 32px;
    width: 32px;
    position: relative;
    transition: 0.5s;
}

a {
    text-decoration: none;
}

.help:hover {
    transform: scale(1.2);
}

#cards {
    display: flex;
    flex-wrap: wrap;
    overflow: auto;
    justify-content: center;
    column-gap: 32px;
}

.card-container {
    border-radius: 12px; /* скругленные углы */
    padding: 0; /* отступы внутри карточки */
    margin-bottom: 10px; /* отступ снизу между карточками */
    width: 300px; /* максимальная ширина карточки */
    box-sizing: border-box; /* чтобы padding не увеличивал размеры карточки */

    background-color: rgb(10, 25, 41);
    color: rgb(255, 255, 255);
    transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
    border: 1px solid rgba(255, 255, 255, 0.12);

    width: 350px;
    height: 400px;

}

.card-image {
    max-width: 100%; /* изображение не должно выходить за границы карточки */
    height: auto; /* автоматическая высота для сохранения пропорций */
    display: block; /* чтобы изображение не имело отступы снаружи */
    margin-bottom: 5px; /* отступ снизу между изображением и текстом */

    border-radius: 12px 12px 0 0;
}

.card-caption {
    margin: 0; /* убираем внешние отступы у текста */

    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0.00938em;
    font-family: Nunito, sans-serif;
    color: rgba(255, 255, 255, 0.7);
    padding: 16px;
}

#question {
    display: flex;
    overflow: auto;
    align-items: center;
    column-gap: 16px;

    width: 100%;
    height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px 0;
    margin-top: 30px;
    margin-bottom: 16px;
}

.question-image {
    width: 750px;
    max-height: 100%;
}

.question-title {
    margin: 0px;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.334;
    letter-spacing: 0em;
    font-family: Nunito, sans-serif;
    color: #ffffffd9;
}

.question-caption {
    margin: 0px;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0.00938em;
    font-family: Nunito, sans-serif;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 576px) {
    #question { 
        width: 100%;
        flex-wrap: wrap;
        
        height: auto;
     }
    .question-image {
        width: 90%;
        margin:auto;
        margin-bottom: 8px;
    }
    #question > div {
        width: 90%;
        margin: auto;
    }
    
}

.search-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 14px;
    font-family: Nunito, sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;

    align-items: center;
    gap: 8px;
    font-weight: 500;
    min-width: 100px;
}

.search-btn:hover {
    background: linear-gradient(135deg, #43A047, #1B5E20);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.search-input {
    width: 100%;
    padding: 12px 18px;
    font-size: 16px;
    font-family: Nunito, sans-serif;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(76, 175, 80, 0.5);
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;

    color: white;
}

.search-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
}

.search-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 800px;
    z-index: 2;
    transition: all 0.3s ease;
}

@media (max-width: 1200px) and (min-width: 769px) {
    .search-container {

        width: 40vw; /* 40% от ширины окна просмотра */
        transform: translateX(-50%) scale(0.9);
        gap: 8px;
        min-width: 200px; /* Минимальная ширина для десктопа */
    }
    
    #idInput {
        padding: 8px 10px !important;
        font-size: 13px;
        min-width: 120px;
    }
    
    #examMode {
        transform: scale(0.9);
    }
    
    #examMode + label {
        font-size: 12px;
    }
    
    #askBtn {
        padding: 8px 12px !important;
        font-size: 12px;
        min-width: 65px;
    }

    .word-search-container {
        width: 25vw;
        min-width: 200px;
        gap: 6px;
    }

        /* Элементы внутри второго контейнера */
    #searchInput {
        font-size: 13px;
        padding: 7px 9px !important;
        min-width: 120px;
    }
    
    #WordBtn {
        min-width: 40px !important;
        padding: 7px !important;
        font-size: 12px;
    }
    
    #WordBtn i {
        font-size: 13px;
    }
}


/* Стили для контейнера результатов поиска */
#searchResults {
    background-color: rgba(10, 25, 41, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

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

/* Заголовок результатов */
#searchResults h3 {
    margin: 0 0 20px 0;
    font-weight: 500;
    font-size: 1.75rem;
    line-height: 1.2;
    color: #ffffff;
    font-family: Nunito, sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
}

#searchResults h3::before {
    content: "🔍";
    font-size: 1.5rem;
}

/* Кнопка очистки результатов */
#clearResultsBtn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-family: Nunito, sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

#clearResultsBtn::before {
    content: "×";
    font-size: 18px;
    font-weight: bold;
}

#clearResultsBtn:hover {
    background: linear-gradient(135deg, #e53935, #b71c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

#clearResultsBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

/* Заголовки таблиц */
#searchResults h4 {
    margin: 25px 0 15px 0;
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    font-family: Nunito, sans-serif;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(76, 175, 80, 0.5);
}

/* Таблицы */
#testsTable, #cardsTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Заголовки таблиц */
#testsTable thead, #cardsTable thead {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(46, 125, 50, 0.2));
}

#testsTable th, #cardsTable th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    font-family: Nunito, sans-serif;
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
}

/* Ячейки таблиц */
#testsTable td, #cardsTable td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-family: Nunito, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Чередование строк */
#testsTable tbody tr:nth-child(even),
#cardsTable tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

#testsTable tbody tr:hover,
#cardsTable tbody tr:hover {
    background-color: rgba(76, 175, 80, 0.1);
    transition: background-color 0.2s ease;
}

/* Изображения в таблицах */
#testsTable img, #cardsTable img {
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#testsTable img:hover, #cardsTable img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Текст "No image" */
#testsTable td:last-child:not(:has(img)),
#cardsTable td:last-child:not(:has(img)) {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    #searchResults {
        padding: 16px;
        margin-top: 15px;
    }
    
    #searchResults h3 {
        font-size: 1.5rem;
    }
    
    #clearResultsBtn {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    #testsTable, #cardsTable {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    #testsTable th, #cardsTable th,
    #testsTable td, #cardsTable td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    #testsTable img, #cardsTable img {
        max-width: 80px;
        max-height: 80px;
    }
}

@media (max-width: 576px) {
    #searchResults h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #testsResults, #cardsResults {
        margin-top: 20px;
    }
    
    #searchResults h4 {
        font-size: 1.1rem;
    }
}

#testsTable th:nth-child(1),
#testsTable td:nth-child(1),
#cardsTable th:nth-child(1),
#cardsTable td:nth-child(1) {
    width: 70px; /* или любое другое значение, например 130px, 140px */
    min-width: 70px;
}

@media (max-width: 768px) {
    header {
        height: auto !important;
        padding: 12px !important;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* Первая строка: ID теста + чекбокс + кнопка "Найти" */
    .search-container {
        position: static !important;
        transform: none !important;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    #idInput {
        flex: 1;
        min-width: 140px;
    }
    
    /* Вторая строка: поиск по словам + кнопки */
    header > div:nth-child(3) {
        width: 100%;
        display: flex;
        gap: 8px;
    }
    
    /* Гирлянда - делаем её фоном */
    .ny-garland {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0.2;
        z-index: -1;
        overflow: hidden;
    }
    
    .ny-garland img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .help {
        flex-shrink: 0;
    }
}
@media (max-width: 768px) {
    .ny-garland {
        display: none;
    }
}

/* Мобильная версия таблиц результатов поиска */
@media (max-width: 768px) {
    /* Контейнеры таблиц */
    #testsResults, #cardsResults {
        margin-top: 15px;
    }
    
    /* Заголовки таблиц */
    #testsResults h4, #cardsResults h4 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    /* Таблицы */
    #testsTable, #cardsTable {
        font-size: 13px;
        min-width: 100%;
        table-layout: fixed; /* Фиксированная раскладка для контроля ширины */
    }
    
    /* Заголовки колонок */
    #testsTable th, #cardsTable th {
        padding: 12px 8px;
        font-size: 12px;
        white-space: normal; /* Позволяем переносить текст заголовков */
    }
    
    /* Ячейки таблиц */
    #testsTable td, #cardsTable td {
        padding: 10px 8px;
        font-size: 12px;
        line-height: 1.3;
        word-wrap: break-word; /* Перенос длинных слов */
        overflow-wrap: break-word; /* Современный вариант */
        hyphens: auto; /* Автоматическое расставление переносов */
    }
    
    /* Колонка Test ID */
    #testsTable td:nth-child(1),
    #cardsTable td:nth-child(1),
    #testsTable th:nth-child(1),
    #cardsTable th:nth-child(1) {
        width: 70px; /* Фиксированная ширина для ID */
        min-width: 70px;
        max-width: 70px;
        text-align: center;
    }
    
    /* Колонка Text (текстовое описание) */
    #testsTable td:nth-child(2),
    #cardsTable td:nth-child(2),
    #testsTable th:nth-child(2),
    #cardsTable th:nth-child(2) {
        width: auto;
        min-width: 150px;
        max-width: 300px;
        white-space: normal; /* Разрешаем перенос текста */
        word-break: break-word; /* Перенос по словам */
    }
    
    /* Колонка Image */
    #testsTable td:nth-child(3),
    #cardsTable td:nth-child(3),
    #testsTable th:nth-child(3),
    #cardsTable th:nth-child(3) {
        width: 100px; /* Фиксированная ширина для изображений */
        min-width: 100px;
        max-width: 100px;
    }
    
    /* Колонка ID (последняя в cardsTable) */
    #cardsTable td:nth-child(4),
    #cardsTable th:nth-child(4) {
        width: 50px; /* Еще уже для ID карточек */
        min-width: 50px;
        max-width: 50px;
        font-size: 11px;
        text-align: center;
    }
    
    /* Изображения в таблицах */
    #testsTable img, #cardsTable img {
        max-width: 80px !important;
        max-height: 80px !important;
        width: auto;
        height: auto;
    }
    
    /* Текст "No image" */
    #testsTable td:last-child:not(:has(img)),
    #cardsTable td:last-child:not(:has(img)) {
        font-size: 11px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    #testsTable, #cardsTable {
        font-size: 12px;
    }
    
    #testsTable th, #cardsTable th {
        padding: 10px 6px;
        font-size: 11px;
    }
    
    #testsTable td, #cardsTable td {
        padding: 8px 6px;
        font-size: 11px;
        line-height: 1.2;
    }
    
    /* Еще уже колонки */
    #testsTable td:nth-child(1),
    #cardsTable td:nth-child(1),
    #testsTable th:nth-child(1),
    #cardsTable th:nth-child(1) {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
    }
    
    /* Колонка Text еще уже */
    #testsTable td:nth-child(2),
    #cardsTable td:nth-child(2),
    #testsTable th:nth-child(2),
    #cardsTable th:nth-child(2) {
        min-width: 120px;
        max-width: 250px;
    }
    
    /* Колонка Image уже */
    #testsTable td:nth-child(3),
    #cardsTable td:nth-child(3),
    #testsTable th:nth-child(3),
    #cardsTable th:nth-child(3) {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
    }
    
    #cardsTable td:nth-child(4),
    #cardsTable th:nth-child(4) {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        font-size: 10px;
    }
    
    /* Изображения еще меньше */
    #testsTable img, #cardsTable img {
        max-width: 60px !important;
        max-height: 60px !important;
    }
}

/* Дополнительные улучшения для удобства чтения */
@media (max-width: 768px) {
    /* Ограничиваем максимальную ширину таблиц */
    #testsTable, #cardsTable {
        max-width: 100vw;
    }
    
    /* Делаем строки более компактными */
    #testsTable tbody tr, #cardsTable tbody tr {
        height: auto;
        min-height: 50px;
    }
    
    /* Улучшаем читаемость при переносе текста */
    #testsTable td:nth-child(2),
    #cardsTable td:nth-child(2) {
        text-align: justify;
        hyphens: auto;
        -webkit-hyphens: auto;
        -moz-hyphens: auto;
    }
    
    /* Заголовок результатов поиска */
    #searchResults h3 {
        font-size: 1.3rem;
    }
}
