/* Темно-фиолетовая цветовая схема */
:root {
    --primary-dark: #2d1b3d;
    --primary-medium: #4a2c5a;
    --primary-light: #6b3d7a;
    --accent-purple: #8b5a9b;
    --accent-light: #a67bb8;
    --text-primary: #ffffff;
    --text-secondary: #e0d0e8;
    --text-muted: #c0b0d0;
    --border-color: #5a3d6a;
    --hover-bg: #3d2b4d;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Хэдер */
header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
    overflow: visible;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.5rem;
    width: 100%;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
}

.logo-link img {
    height: 50px;
    width: auto;
    display: block;
}

/* Кнопка меню для мобильных */
.menu-item {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
    position: relative;
    overflow: visible;
    flex-shrink: 0;
}

.menu-item span {
    width: 24px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
    position: absolute;
}

.menu-item span:nth-child(1) {
    top: 12px;
}

.menu-item span:nth-child(2) {
    top: 18.5px;
}

.menu-item span:nth-child(3) {
    top: 25px;
}

.menu-item.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 18.5px;
}

.menu-item.active span:nth-child(2) {
    opacity: 0;
}

.menu-item.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 18.5px;
}

/* Навигация в хэдере (только на главной) */
.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
    justify-content: flex-end;
}

.header-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-light);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.header-nav a:hover {
    background-color: var(--hover-bg);
    color: var(--accent-light);
}

.header-nav a:hover::after {
    width: 80%;
}

/* Реферальная ссылка */
.referral-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-light) 100%);
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-block;
    margin-left: 0;
    flex-shrink: 0;
}

.referral-link:hover {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-purple) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

/* Стили для ссылок в контенте */
section a {
    color: var(--accent-light);
    text-decoration: underline;
    transition: color 0.3s ease;
}

section a:hover {
    color: var(--accent-purple);
    text-decoration: none;
}

/* Основной контент */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow);
    
    scroll-margin-top: 100px;
}

/* Обертка для контента на главной странице */
.content-wrapper {
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow);
}

.content-wrapper > section {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-top: 0;
    scroll-margin-top: 100px;
}

.content-wrapper > section:not(:first-child) {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-light);
    text-shadow: 2px 2px 4px var(--shadow);
    text-align: center;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
    color: var(--accent-purple);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    text-align: left;
}

h2:first-of-type {
    margin-top: 0;
}

h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
    color: var(--accent-purple);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    text-align: left;
}

h3:first-of-type {
    margin-top: 0;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.5rem;
}

/* Таблицы */
.table-wrapper {
    width: 100%;
    margin: 1.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background-color: var(--primary-medium);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
    min-width: 600px;
}

thead {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-purple) 100%);
}

th {
    padding: 1rem;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tbody tr:hover {
    background-color: var(--hover-bg);
    transition: background-color 0.3s ease;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Списки определений (FAQ) */
dl {
    margin: 1.5rem 0;
}

dt {
    font-weight: 600;
    color: var(--accent-light);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    padding-left: 1rem;
    border-left: 3px solid var(--accent-purple);
}

/* Изображения */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Баннеры */
.main-banner,
.section-banner {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    width: 100%;
    display: block;
}

.main-banner {
    margin: 2rem 0;
}

.section-banner {
    margin: 1.5rem 0;
}

/* Блок автора */
.author-intro {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.author-content {
    flex: 1;
}

.author-content p {
    margin-bottom: 0;
}

.author-photo {
    width: 220px;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    display: block;
}

/* Футер */
footer {
    background: linear-gradient(135deg, var(--primary-medium) 0%, var(--primary-dark) 100%);
    border-top: 2px solid var(--border-color);
    padding: 2rem;
    margin-top: auto;
    box-shadow: 0 -2px 10px var(--shadow);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo {
    display: inline-block;
    text-decoration: none;
}

.footer-logo img {
    height: 50px;
    width: auto;
    display: block;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.footer-nav a:hover {
    color: var(--accent-light);
    background-color: var(--hover-bg);
}

.footer-copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Кнопка "Вверх" */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-light) 100%);
    color: var(--text-primary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--shadow);
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-purple) 100%);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

.scroll-to-top.show {
    display: flex;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .header-nav{
        gap: 0.5rem;
    }

    .footer-nav{
        gap: 0.05rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0 1rem;
    }

    .header-container {
        gap: 1rem;
        padding: 0.8rem 0;
    }

    .logo-link img {
        height: 42px;
    }

    /* Скрываем навигацию и кнопку меню на мобильных устройствах */
    .header-nav {
        display: none !important;
    }

    .menu-item {
        display: none !important;
    }

    .referral-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin-block: auto;
    }

    main {
        padding: 1rem;
    }

    section {
        padding: 1.5rem;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    .content-wrapper > section:not(:first-child) {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .author-intro {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-content {
        text-align: center;
    }

    .author-content p {
        text-align: left;
    }

    .author-photo {
        width: 100%;
        max-width: 260px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .footer-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .author-intro {
        align-items: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem;
    }
}

@media (max-width: 375px) {
    main {
        padding: 0;
    }

    .content-wrapper {
        margin-bottom: 0;
        padding: 1rem;
        border-radius: 0;
    }

    .table-wrapper {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--accent-purple) var(--primary-dark);
    }

    .table-wrapper::-webkit-scrollbar {
        height: 8px;
    }

    .table-wrapper::-webkit-scrollbar-track {
        background: var(--primary-dark);
        border-radius: 4px;
    }

    .table-wrapper::-webkit-scrollbar-thumb {
        background: var(--accent-purple);
        border-radius: 4px;
    }

    .table-wrapper::-webkit-scrollbar-thumb:hover {
        background: var(--accent-light);
    }

    table {
        min-width: 500px;
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.4rem;
    }
}

