@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Цветовая палитра */
:root {
    --bg: linear-gradient(135deg, #e6f0fa, #f0f7ff);
    --card-bg: linear-gradient(145deg, #ffffff, #f8fafc);
    --accent: #007bff;
    --accent-hover: #0056b3;
    --text: #1a202c;
    --muted: #6b7280;
    --shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    --border: #e2e8f0;
}

/* Общие стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%; 
    margin: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

main {
    flex: 1 0 auto; 
}

/* Шапка */
.site-header, .lesson-header {
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
    color: #fff;
    padding: 20px 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
}

.site-header h1, .lesson-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

nav {
    margin-top: 12px;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: #e0f2fe;
    margin: 0 12px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #ffffff;
}

/* Контейнер */
.container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Карточки */
.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease-out;
}

.card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent);
}

.card p {
    font-size: 16px;
    margin-bottom: 12px;
}

.card ul {
    list-style: none;
    padding: 0;
}

.card ul li {
    font-size: 15px;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.card ul li::before {
    content: '⚡️';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Карточки в сетке */
.card {
    width: 100%;
}

/* Кнопки */
.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

.button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

/* Видео */
.videos-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.video.card {
    width: 100%;
}

.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.video-wrap iframe {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Викторина */
.quiz-controls {
    margin-top: 16px;
}

#quiz {
    margin-top: 12px;
}

.choice {
    display: block;
    margin: 8px 0;
    font-size: 16px;
}

.choice input[type="radio"] {
    margin-right: 8px;
}

/* Прогресс */
.progress {
    height: 10px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.progress > i {
    display: block;
    height: 100%;
    background: var(--accent);
}

/* Таблица медалей */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

tr:nth-child(even) {
    background: #f8fafc;
}

/* Элементы интерфейса */
.controls {
    margin-top: 16px;
}

.medal-badge {
    font-size: 24px;
    animation: bounce 0.5s ease infinite alternate;
}

.status {
    font-size: 14px;
    color: var(--muted);
    margin-left: 12px;
}

.status.completed::before {
    content: "✓ Завершено";
    color: #10b981;
    font-weight: 500;
}

.notification {
    font-size: 14px;
    color: #10b981;
    margin-left: 12px;
    display: inline-block;
    animation: fadeIn 0.5s ease;
}

/* Футер */
.site-footer {
    padding: 20px;
    text-align: center;
    color: #e0f2fe;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border-top: 2px solid var(--border);
    flex-shrink: 0; /* Футер не сжимается */
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

/* Адаптивность */
@media (max-width: 900px) {
    .small {
        width: 48%;
        margin-right: 4%;
    }
    .small:nth-child(2n) {
        margin-right: 0;
    }
}

@media (max-width: 700px) {
    .small {
        width: 100%;
        margin-right: 0;
    }
    .videos-container {
        grid-template-columns: 1fr;
    }
    .site-header h1, .lesson-header h1 {
        font-size: 22px;
    }
    .card h2 {
        font-size: 20px;
    }
    nav a {
        margin: 0 8px;
    }
}

/* Всплывающее окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeIn 0.3s ease-out;
}

.modal-content h3 {
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 12px;
}

.modal-content p {
    font-size: 16px;
    margin-bottom: 16px;
}

.modal-content button {
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.modal-content button:hover {
    background: var(--accent-hover);
}

/* Стили для формы регистрации */
#register-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

#register-form label {
    font-weight: 500;
    color: var(--text);
}

#register-form input {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
}

#register-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

#register-message {
    margin-top: 12px;
    font-size: 16px;
    text-align: center;
    color: #10b981;
}

/* Feedback для викторины */
.question label.correct-answer {
    background-color: #d4edda !important;
    color: #155724 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    border: 2px solid #c3e6cb !important;
    font-weight: bold !important;
    display: block !important;
    margin: 4px 0 !important;
}

.question label.wrong-answer {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    border: 2px solid #f5c6cb !important;
    text-decoration: line-through !important;
    display: block !important;
    margin: 4px 0 !important;
}

