* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-gradient: linear-gradient(145deg, #fef9f0 0%, #f3f0fc 100%);
    --card-white: #ffffff;
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --primary-light: #a78bfa;
    --text-dark: #1e1b2e;
    --text-muted: #4a4a5e;
    --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 35px -12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(30, 27, 46, 0.95);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
}

.nav-container {
    width: 100%;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-menu li a {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 40px;
    color: #f1f5f9;
    text-decoration: none;
    transition: all 0.25s ease;
}

.nav-menu li a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-menu li a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

/* Main content */
main {
    flex: 1;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Hero section */
.hero {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 60rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    border-radius: 48px;
    padding: 2.8rem;
    text-align: center;
    margin: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.hero-text {
    font-size: 1.2rem;
    color: #f0eef7;
    margin-bottom: 2rem;
}

/* Buttons */
.btn-telegram {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #2b96e0;
    padding: 0.9rem 2rem;
    border-radius: 60px;
    color: white;
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s;
}

.btn-telegram:hover {
    background: #1e7ebf;
    transform: scale(1.02);
}

.btn-youtube {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ff0000;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}

.btn-youtube:hover {
    background: #cc0000;
    transform: scale(1.02);
}

.btn-youtube.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Section headers */
.section-header {
    font-size: 2.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--primary);
    padding-left: 1.2rem;
}

/* Info note */
.info-note {
    background: #ede9fe;
    border-left: 6px solid var(--primary);
    padding: 1.2rem;
    border-radius: 20px;
    margin: 1.5rem 0;
}

/* Lists */
.styled-list {
    list-style: none;
    margin: 1rem 0;
}

.styled-list li {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    position: relative;
    padding-left: 38px;
}

.styled-list li::before {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--primary);
    font-weight: bold;
    content: "•";
}

.check-list li::before {
    content: "✓";
    font-size: 1.2rem;
}

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
    margin: 2rem 0;
}

.card {
    background: var(--card-white);
    border-radius: 28px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: 0.25s;
    border: 1px solid #e9e4ff;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.card h4 {
    color: var(--primary-dark);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.card h5 {
    color: var(--primary-light);
    margin-bottom: 1rem;
}

/* Lecture cards */
.lecture-card {
    background: var(--card-white);
    border-radius: 32px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.lecture-header {
    background: linear-gradient(98deg, #f5f3ff 0%, #ffffff 100%);
    padding: 1.2rem 1.8rem;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-light);
}

.lecture-header span:first-child {
    color: var(--primary-dark);
}

.toggle-icon {
    font-size: 1.8rem;
    transition: transform 0.2s;
}

.lecture-card.open .toggle-icon {
    transform: rotate(45deg);
}

.lecture-body {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.lecture-card.open .lecture-body {
    max-height: 2000px;
    padding: 1.5rem 2rem;
}

.lecture-content h3, .lecture-content h4 {
    margin: 1rem 0 0.5rem;
    color: var(--primary-dark);
}

.lecture-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.lecture-content p {
    margin-bottom: 0.8rem;
}

.quiz-btn {
    margin-top: 1.5rem;
    background: var(--primary-light);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.quiz-btn:hover {
    background: var(--primary);
    color: white;
}

/* ========== СТИЛИ ДЛЯ ТЕСТА ========== */
.quiz-container {
    background: white;
    border-radius: 28px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e9e4ff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    max-height: 600px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Стилизация скроллбара */
.quiz-container::-webkit-scrollbar {
    width: 8px;
}

.quiz-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.quiz-container::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.quiz-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.paged-questions {
    margin-bottom: 1rem;
}

.quiz-question {
    background: #faf9ff;
    border-radius: 20px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border: 1px solid #f0ebff;
    transition: all 0.2s ease;
}

.quiz-question:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
    border-color: var(--primary-light);
}

.question-text {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1rem;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e9e4ff;
}

.quiz-option:hover {
    background: #f3efff;
    border-color: var(--primary-light);
}

.quiz-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.quiz-option span {
    flex: 1;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Навигация */
.quiz-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0 0.5rem 0;
    padding: 0.5rem 0;
    background: transparent;
    border-top: 1px solid #e9e4ff;
    position: relative;
    z-index: 5;
}

.quiz-nav-btn {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.quiz-nav-btn:hover:not(:disabled) {
    background: var(--primary);
    transform: translateY(-2px);
}

.quiz-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    font-weight: 600;
    color: var(--primary-dark);
    background: #ede9fe;
    padding: 0.3rem 1rem;
    border-radius: 40px;
}

.answered-info {
    text-align: center;
    margin: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: #f8f7fc;
    padding: 0.4rem;
    border-radius: 40px;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Кнопка завершения теста - важные стили */
.submit-paged-test {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-size: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: block;
    text-align: center;
}

.submit-paged-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.quiz-result {
    display: none;
    margin-top: 1rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f0fa 100%);
    border-radius: 20px;
    border-left: 4px solid var(--primary);
}

.quiz-result-content {
    text-align: center;
}

.result-score {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.reset-test {
    background: var(--primary-light);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 0.5rem;
}

.reset-test:hover {
    background: var(--primary);
    color: white;
}

/* Test styles from main.js (старые, для обратной совместимости) */
.question {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.result {
    font-size: 22px;
    margin-left: 10px;
    font-weight: bold;
}

.correct { color: #10b981; }
.wrong { color: #ef4444; }

.finish {
    display: none;
    margin-top: 20px;
    font-size: 18px;
    color: #10b981;
    text-align: center;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 12px;
}

/* Audio list */
.audio-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    margin: 1.5rem 0;
}

.audio-item {
    background: #f8f6ff;
    border-radius: 60px;
    padding: 0.5rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.gallery-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: var(--shadow-sm);
}

.gallery-img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 24px;
}

.close-lightbox {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 44px;
    color: white;
    cursor: pointer;
}

/* Swiper */
.swiper {
    margin: 2rem 0;
    padding-bottom: 2rem;
}

.sand-card {
    background: white;
    border-radius: 28px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    min-height: 280px;
}

.sand-card h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Links grid */
.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.youtube-link, .youtube-links {
    text-align: center;
    margin: 2rem 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid #ddd;
    margin-top: 2rem;
}

/* Instagram Button Styles */
.btn-instagram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    padding: 1rem 2rem;
    border-radius: 60px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
}

.btn-instagram::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-instagram:hover::before {
    left: 100%;
}

.btn-instagram:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.btn-instagram:active {
    transform: translateY(0px);
}

.instagram-icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-instagram:hover .arrow-icon {
    transform: translateX(5px);
}

.btn-instagram span {
    letter-spacing: 0.5px;
}

/* Download button styles */
.download-section {
    margin: 1rem 0 0.5rem 0;
    text-align: right;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #10b981;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-download svg {
    transition: transform 0.2s ease;
}

.btn-download:hover svg {
    transform: translateY(2px);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 1.6rem; }
    .section-header { font-size: 1.8rem; }
    .nav-menu li a { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
    .lecture-header { font-size: 1rem; padding: 1rem; }
    .hero-content { padding: 1.5rem; margin: 1rem; }
    .btn-instagram {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        gap: 8px;
    }
    .instagram-icon {
        width: 20px;
        height: 20px;
    }
    .arrow-icon {
        width: 18px;
        height: 18px;
    }
    .quiz-container {
        padding: 1rem;
        max-height: 450px;
    }
    .quiz-question {
        padding: 1rem;
    }
    .quiz-option {
        padding: 0.5rem 0.8rem;
    }
    .quiz-option span {
        font-size: 0.85rem;
    }
    .quiz-nav {
        gap: 1rem;
        margin: 0.5rem 0 0.25rem 0;
        padding: 0.4rem 0;
    }
    .quiz-nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    .submit-paged-test {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    .answered-info {
        font-size: 0.8rem;
        padding: 0.3rem;
    }
    .download-section {
        text-align: center;
        margin: 1rem 0;
    }
    .btn-download {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        width: 100%;
        justify-content: center;
    }
}