/* Общие стили */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: white;
    overflow-x: hidden; /* Разрешаем вертикальную прокрутку при необходимости */
    user-select: none; /* Убираем возможность выделения текста */
    cursor: default; /* Устанавливаем стандартный курсор */
    position: relative;
    width: 100%;
    min-height: 100vh; /* Изменено с height на min-height для разрешения прокрутки */
    -webkit-tap-highlight-color: transparent; /* Убираем синее выделение при тапе на мобильных */
}

/* Анимированный градиент */
.gradient {
    position: fixed; /* Изменено с absolute на fixed для корректного отображения при прокрутке */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(149deg, rgba(24, 187, 156, 1) 0%, rgba(106, 57, 175, 1) 25%, rgb(194, 40, 158) 50%, rgba(115, 53, 134, 1) 75%, rgba(24, 187, 156, 1) 100%);
    animation: gradient 40s infinite linear;
    background-size: 500%;
    z-index: -1;
}

/* Анимация градиента */
@keyframes gradient {
    0% {
        background-position: 80% 0%;
    }
    50% {
        background-position: 20% 100%;
    }
    100% {
        background-position: 80% 0%;
    }
}

/* Боковое меню */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Более темный фон для лучшей читаемости */
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(5px); /* Эффект размытия фона для iOS */
    -webkit-backdrop-filter: blur(5px); /* Для Safari */
}

.sidebar.open {
    left: 0;
}

/* Список меню */
.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: center;
    margin-top: 40px; /* Больше отступ для удобства на мобильных */
}

.sidebar li {
    margin-bottom: 20px; /* Больше отступ между пунктами меню */
}

.sidebar a {
    text-decoration: none;
    color: white;
    font-size: 20px; /* Увеличиваем размер шрифта для мобильных */
    transition: color 0.3s ease;
    padding: 10px 0; /* Добавляем отступы для увеличения области нажатия */
    display: block;
}

.sidebar a:hover {
    color: #ffcc00;
}

/* Гамбургер-кнопка */
.menu-btn {
    width: 44px; /* Минимальный размер для удобного нажатия на мобильных */
    height: 44px;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
    touch-action: manipulation; /* Улучшает отзывчивость на мобильных */
    border: none; /* Убираем стандартную рамку у button */
    outline: none; /* Убираем outline при фокусе */
    padding: 0; /* Убираем внутренние отступы */
}

.menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.menu-btn:active {
    transform: scale(0.95); /* Эффект нажатия на мобильных */
}

/* Убираем синюю рамку при фокусе на мобильных */
.menu-btn:focus {
    outline: none;
    box-shadow: none;
}

.menu-btn .bar {
    width: 24px; /* Увеличиваем для лучшей видимости */
    height: 3px; /* Увеличиваем толщину */
    background-color: white;
    position: absolute;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.menu-btn .bar:nth-of-type(1) {
    transform: translateY(-8px);
}

.menu-btn .bar:nth-of-type(2) {
    transform: translateY(0px);
}

.menu-btn .bar:nth-of-type(3) {
    transform: translateY(8px);
}

/* Анимация для кнопки при активации */
.menu-btn.active .bar:nth-of-type(1) {
    transform: rotate(45deg) translateY(0px) translateX(0px);
}

.menu-btn.active .bar:nth-of-type(2) {
    opacity: 0;
}

.menu-btn.active .bar:nth-of-type(3) {
    transform: rotate(-45deg) translateY(0px) translateX(0px);
}

/* Главный контейнер */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Восстанавливаем центрирование по вертикали */
    min-height: 100vh; /* Изменено с height на min-height для разрешения прокрутки */
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Контейнер для страниц с длинным контентом (о себе и др.) */
.container.long-content {
        justify-content: flex-start;
    padding-top: 80px; /* Добавляем отступ сверху для меню */
    padding-bottom: 40px; /* Добавляем отступ снизу */
    }
    
/* Стиль имени */
.name {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    text-align: center;
    line-height: 1.2;
    padding: 0 10px;
    }
    
/* Логотип */
.logo {
    width: 480px; /* Фиксированная ширина для десктопа */
    height: 272px; /* Фиксированная высота для сохранения пропорций */
    margin: 20px auto;
    display: block;
    object-fit: contain; /* Сохраняем пропорции изображения */
    }
    
/* Кнопки соцсетей */
.social-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 0 10px;
}

.social-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    touch-action: manipulation; /* Улучшает отзывчивость на мобильных */
}

.social-button:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.social-button:active {
    transform: scale(0.95); /* Эффект нажатия на мобильных */
}

.social-button i {
    font-size: 24px;
    color: white;
}

/* Снежинки */
.snowflake {
    position: fixed !important;
    top: -50px;
    color: white;
    font-size: 1em;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
    user-select: none;
    pointer-events: none !important;
    z-index: 100 !important;
    opacity: 0.8;
    max-width: 30px;
    max-height: 30px;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    }
    
    .name {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .logo {
        width: 240px; /* Фиксированная ширина для мобильных */
        height: 136px; /* Фиксированная высота для сохранения пропорций 480:272 = 240:136 */
        margin: 15px auto;
    }

    .social-button {
        width: 44px; /* Увеличиваем для удобства нажатия */
        height: 44px;
    }

    .social-button i {
        font-size: 22px;
    }
    
    /* Боковое меню для мобильных */
    .sidebar {
        width: 100%; /* На мобильных меню занимает всю ширину */
        left: -100%;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar a {
        font-size: 22px; /* Еще больше для мобильных */
        padding: 12px 0;
    }
    
    /* Снежинки для мобильных */
    .snowflake {
        font-size: 16px !important;
        max-width: 25px !important;
        max-height: 25px !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .name {
        font-size: 28px;
        padding: 0 5px;
    }
    
    .logo {
        width: 200px; /* Фиксированная ширина для очень маленьких экранов */
        height: 113px; /* Сохраняем пропорции 480:272 = 200:113 */
    }
    
    .social-buttons {
        gap: 10px;
    }
    
    .social-button {
        width: 40px;
        height: 40px;
    }
    
    .social-button i {
        font-size: 20px;
    }
    
    .menu-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        left: 10px;
    }
    
    .menu-btn .bar {
        width: 20px;
        height: 2px;
    }
    
    .sidebar a {
        font-size: 20px;
    }
}

/* Для ландшафтной ориентации на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding-top: 60px; /* Добавляем отступ сверху для меню */
        height: auto;
        min-height: 100vh;
        justify-content: flex-start;
    }
    
    .name {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .logo {
        width: 160px;
        height: 91px;
        margin: 10px auto;
    }
    
    .social-buttons {
        margin-top: 10px;
    }
}

/* Оптимизация для высоких экранов */
@media (min-height: 800px) {
    .container {
        justify-content: center; /* Всегда центрируем на высоких экранах */
    }
}

