/* === Переменные цвета === */
:root {
    --primary-color: #3a86ff;
    --secondary-color: #8338ec;
    --accent-color: #ff006e;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #e9ecef;
    --hover-color: #0056b3;
}

/* === Сброс и базовые стили === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === Контейнер === */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* === Шапка === */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-right: 300px; /* для user-dropdown */
}

/* === Выпадающее меню пользователя === */
.user-dropdown {
    position: absolute;
    top: 1rem;
    right: 2rem;
    z-index: 1000;
    min-width: 200px;
}

.user-dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    transition: background-color 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    width: 220px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    display: none;
    animation: dropdownFade 0.3s ease-out;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown.active .user-dropdown-menu {
    display: block;
}

.user-info {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.dropdown-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-link i {
    width: 20px;
    text-align: center;
}

/* === Навигация === */
nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

nav ul li {
    margin-right: 10px;
    margin-bottom: 5px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: block;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tests-btn {
    background-color: var(--accent-color);
    font-weight: 500;
}

.tests-btn:hover {
    background-color: #e5006c;
}

/* === Основной контент (index и tests общие блоки) === */
main {
    padding: 2rem 0;
    flex: 1;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.description, .image-section {
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.description h2, .image-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.description p {
    margin-bottom: 1rem;
}

.description ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.description ul li {
    margin-bottom: 0.5rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.start-btn, .info-btn, .continue-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.start-btn:hover, .info-btn:hover, .continue-btn:hover {
    transform: translateY(-2px);
}

.start-btn {
    background-color: var(--primary-color);
    color: white;
}

.start-btn:hover {
    background-color: var(--hover-color);
}

.info-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.info-btn:hover {
    background-color: rgba(58, 134, 255, 0.1);
}

.continue-btn {
    background-color: var(--secondary-color);
    color: white;
    width: 100%;
}

.continue-btn:hover {
    background-color: #7029d6;
}

/* === Картинка и прогресс === */
.image-container {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.image-container:hover img {
    transform: scale(1.02);
}

.progress-container {
    background-color: var(--gray-color);
    padding: 1.5rem;
    border-radius: 8px;
}

.progress-container h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.progress-bar {
    height: 10px;
    background-color: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
    transition: width 1s ease;
}

.progress-container p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* === Подвал === */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

/* === Темная тема === */
body.dark-theme .user-dropdown-menu {
    background-color: #333;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.2rem;
        padding-right: 0;
        margin-bottom: 50px;
    }

    .user-dropdown {
        top: 40px;
        right: 20px;
    }

    nav ul {
        justify-content: center;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .start-btn, .info-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.8rem 0;
    }

    .description, .image-section {
        padding: 1.5rem;
    }

    nav ul li a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}