/* === ОСНОВНОЕ ОФОРМЛЕНИЕ === */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: linear-gradient(#9ed2ff, #65c3ff);
    min-height: 100vh;
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    left: -200px;
    width: 200%;
    height: 150px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    filter: blur(40px);
    animation: cloud-move 60s linear infinite;
    pointer-events: none;
}

body::after {
    top: 60%;
    animation-duration: 90s;
}

@keyframes cloud-move {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

h2 {
    text-align: center;
    color: white;
    margin: 16px 0;
}

/* === КОНТЕЙНЕРЫ === */
.container,
.profile-container,
.test-container,
.knowledge-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px 10px 80px;

    background-image:
        linear-gradient(to bottom, rgba(101, 195, 255, 0.6), rgba(14, 124, 197, 0.8)),
        url('/static/bg.jpg'); /* <-- путь к твоему изображению */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* === КАРТОЧКИ === */
.card, .topic-card, .test-card, .user-card, .question-card, .result-card {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    color: #333;
}

.card h3, .test-card h3 {
    margin-top: 0;
}

.test-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-top: 8px;
}

/* === КНОПКИ === */
button, .btn, .admin-btn, .primary-btn, .start-btn {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: 0.2s;
}

.primary-btn { background-color: #4a90e2; color: white; }
.primary-btn:hover { background-color: #357abd; }

.admin-btn { background-color: #28a745; color: white; }
.admin-btn:hover { background-color: #218838; }

.admin-btn.danger { background-color: crimson; }
.admin-btn.small { font-size: 12px; padding: 6px 10px; }

.start-btn { background-color: #007bff; color: white; }
.start-btn:hover { background-color: #0056b3; }

.logout-btn {
    background-color: white;
    color: #d00;
    border: 2px solid #d00;
    text-align: center;
}
.logout-btn:hover {
    background-color: #d00;
    color: white;
}

/* === АВАТАР === */
.avatar-section {
    display: flex;
    justify-content: center;
}
.avatar-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
}

/* === ФОРМЫ === */
input[type="text"], input[type="file"], select {
    padding: 10px;
    border: none;
    border-radius: 8px;
    width: 100%;
    font-size: 14px;
    box-sizing: border-box;
}

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

/* === НАВИГАЦИЯ СНИЗУ === */
.nav-dots {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 16px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: auto; /* 📌 толкает вниз */
}


.dot {
    font-size: 22px;
    background: white;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s, background-color 0.2s;
}

.nav-dots a {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: white;
    color: #4a90e2;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: 0.3s ease;
}

.nav-dots a.active {
    background-color: #4a90e2;
    color: white;
    transform: scale(1.1);
}

.dot:hover {
    transform: scale(1.1);
    cursor: pointer;
}

/* Десктоп/планшет — как было: фиксировано */
.nav-wrapper {
    position: fixed;
    bottom: 12px;          /* твоя текущая отступка */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

@media (max-width: 600px) {
  .nav-wrapper {
      position: sticky;
      bottom: 0;
      left: 0;
      right: 0;
      margin-top: 0px;  
      padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
      pointer-events: none;
  }

  .nav-wrapper .nav-dots,
  .nav-wrapper .nav-dots a,
  .nav-wrapper .nav-dots img {
      pointer-events: auto;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
  }
}


.nav-dots a::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 54px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    transition: 0.2s;
    pointer-events: none;
}

.nav-dots a:hover::after {
    opacity: 1;
}

/* === СТАТУС ТЕСТА === */
.test-status.passed { color: green; font-weight: bold; }
.test-status.not-passed { color: crimson; font-weight: bold; }

/* === КОНТРОЛЬНЫЕ ПАНЕЛИ === */
.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.test-card {
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 14px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    transition: transform 0.2s;
}

.test-card:hover {
    transform: translateY(-2px);
}

.test-card-content {
    padding: 14px 16px;
}

.test-card-content h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: bold;
    color: #222;
}

.test-card-content p {
    margin: 0 0 10px;
    font-size: 14px;
    color: #555;
}

.test-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: bold;
}

.test-status.passed {
    color: green;
}

.test-status.not-passed {
    color: crimson;
}

.auth-button-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.auth-action-btn {
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s ease;
}

.login-btn {
    background-color: #007bff;
    color: white;
}

.login-btn:hover {
    background-color: #0056b3;
}

.register-btn {
    background-color: #ffffff;
    border: 2px solid #007bff;
    color: #007bff;
}

.register-btn:hover {
    background-color: #e6f0ff;
}

.registration-container {
    width: 100%;
    max-width: 360px;           /* ограничение по ширине */
    margin: 40px auto;
    padding: 30px 20px;
    border-radius: 12px;
    background-color: #65c3ff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}


.registration-container input[type="text"] {
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    background-color: #f9f9f9;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.1);
    transition: 0.2s ease;
}

.registration-container input[type="text"]:focus {
    outline: none;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px #4a90e2;
}

.registration-container button {
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.registration-container button:hover {
    background-color: #0056b3;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer p {
    margin-bottom: 10px;
    font-size: 14px;
    color: #222;
}

.auth-action-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
    transition: 0.2s ease;
    cursor: pointer;
}

.register-btn {
    background-color: white;
    border: 2px solid #007bff;
    color: #007bff;
}

.register-btn:hover {
    background-color: #e6f0ff;
}

.form-container {
    width: 100%;
    max-width: 480px;
    margin: 40px auto;
    padding: 20px;
    background-color: #65c3ff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.form-container h1 {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

.form-container form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-container input,
.form-container select,
.form-container textarea {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.form-container button,
.form-container input[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-container button:hover,
.form-container input[type="submit"]:hover {
    background-color: #0056b3;
}

.form-container a {
    display: block;
    margin-top: 20px;
    text-align: center;
    color: #222;
    text-decoration: none;
    font-weight: bold;
}

.users-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 20px auto;
    padding: 0 10px;
}

.user-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #ccc;
}

.user-info {
    flex-grow: 1;
}

.user-name {
    font-weight: bold;
    font-size: 15px;
}

.user-page {
    font-size: 13px;
    opacity: 0.7;
}

.user-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sort-filter-form {
    max-width: 600px;
    margin: 0 auto 20px;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sort-options,
.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sort-options label {
    background-color: #65c3ff;
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.sort-options label input {
    margin-right: 4px;
}

.filter-options select {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    background-color: #f9f9f9;
}

.primary-btn.small,
.admin-btn.small {
    font-size: 13px;
    padding: 6px 12px;
}

.admin-btn.danger {
    background-color: crimson;
    color: white;
}

.center-title {
    text-align: center;
    margin: 30px 0 20px;
    font-size: 24px;
}

.test-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 12px 40px;
}

.result-card {
    background: #eef4ff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-size: 14px;
}

.result-card summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 10px;
    outline: none;
}

.result-questions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-card {
    border: 2px solid #4b7ea7;
    border-radius: 10px;
    background-color: #f0f8ff;
    padding: 12px;
}

.question-text {
    font-weight: bold;
    margin-bottom: 6px;
}

.answer-panel {
    padding: 6px 10px;
    margin: 4px 0;
    background-color: #e6f0ff;
    border-radius: 6px;
}

.answer-panel input[type="checkbox"] {
    margin-right: 6px;
}

.answer-panel.correct {
    border-left: 4px solid green;
}

.answer-panel.selected:not(.correct) {
    border-left: 4px solid crimson;
}

.question-result {
    font-weight: bold;
    margin-top: 8px;
    padding-top: 4px;
}

.question-result.correct {
    color: green;
}

.question-result.wrong {
    color: crimson;
}

.admin-btn.danger.small {
    margin-top: 10px;
}

.back-btn {
    margin: 20px auto;
    display: block;
    background-color: white;
    color: #4a4a4a;
    border: 2px solid #4a4a4a;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.back-btn:hover {
    background-color: #4a4a4a;
    color: white;
}


.lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.lang-btn {
    background-color: white;
    color: #4a4a4a;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none;
    border: 2px solid transparent;
    transition: 0.2s ease;
}

.lang-btn:hover {
    background-color: #f0f0f0;
}

.lang-btn.active {
    border-color: #4a90e2;
    background-color: #e6f0ff;
    color: #007bff;
}

/* ====== Zoom mode ====== */
body.zoomed {
    /* Чуть увеличим базовый текст на всей странице */
    font-size: 18px; /* было ~16px по умолчанию */
}

/* Плиточная сетка (иконки/плитки тем) */
body.zoomed .topics-grid .topic-card {
    height: 128px;               /* было 100px */
    padding: 10px 8px;           /* было 6px 4px */
    font-size: 14px;             /* было 12px */
    line-height: 1.25;
}

/* Плитки с иконкой */
body.zoomed .topics-grid .topic-card.icon-card .icon-title {
    font-size: 13px;             /* было 11px */
    padding: 4px 6px;            /* было 2px 4px */
}

/* Список (карточки) для мобилок и десктопа */
body.zoomed .topics-list .topic-list-item {
    gap: 16px;                   /* было 12px */
    padding: 16px;               /* было 12px */
    min-height: unset;
}

body.zoomed .topics-list .topic-list-item img {
    width: 72px;                 /* было 56px */
    height: 72px;                /* было 56px */
    border-radius: 10px;
}

body.zoomed .topics-list .topic-list-title {
    font-size: 18px;             /* было 16px */
    line-height: 1.25;
}

body.zoomed .topics-list .topic-list-desc {
    font-size: 15px;             /* было 13px */
}

body.zoomed .topics-list .topic-open-btn {
    font-size: 15px;             /* было 13px */
    padding: 10px 14px;          /* было 8px 12px */
    border-radius: 10px;
}

/* Кнопки админа на плитках, чтобы не казались слишком мелкими */
body.zoomed .admin-btn.danger.small {
    font-size: 12px;             /* было 11px */
    padding: 6px 10px;           /* было 4px 8px */
}

/* Поле поиска — чтобы пропорции не «проваливались» при увеличении */
body.zoomed #homeSearch {
    padding: 12px 14px;          /* было 10px 12px */
    font-size: 16px;
}
body.zoomed #homeSearchClear {
    padding: 12px 14px;          /* было 10px 12px */
    font-size: 16px;
}

/* Точки навигации, чтобы подписи/иконки смотрелись уместно */
body.zoomed .nav-dots img {
    width: 56px;                 /* было 50px */
    height: 56px;                /* было 50px */
}
