body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #919dceab;
}

header {
    background-color: #111133; /* Новый цвет фона */
    padding: 20px;
    text-align: center;
    width: 100%; /* Шапка на всю ширину */
}

header a {
    color: white; /* Белый цвет текста */
    text-decoration: none;
    font-size: 32px; /* Увеличенный размер текста */
    font-weight: bold;
}

header .subtitle {
    color: white; /* Белый цвет текста */
    font-size: 18px;
    margin-top: 10px;
}

header .telegram-link {
    color: white; /* Белый цвет текста */
    font-size: 16px;
    margin-top: 10px;
}

header .telegram-link a {
    color: white; /* Белый цвет текста */
    text-decoration: none;
    font-weight: bold;
}

header .telegram-link a:hover {
    text-decoration: underline; /* Подчеркивание при наведении */
}

#sort-container {
    text-align: center;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.sort-button {
    padding: 10px 20px;
    background-color: #111133; /* Цвет фона как у шапки */
    color: white; /* Белый цвет текста */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease; /* Плавное изменение цвета */
}

.sort-button.active {
    background-color: #007bff; /* Активная кнопка выделяется синим */
}

.sort-button:hover {
    background-color: #007bff; /* Изменение цвета при наведении */
}

#image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 20px 0;
}

.media-item {
    width: 70%;
    margin-bottom: 5%;
}

.media-header {
    background-color: #111133; /* Заменяем цвет на цвет фона шапки */
    color: white; /* Белый цвет текста */
    padding: 10px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: bold;
}

.image-item {
    background-color: white;
    height: 717px;
    padding: 20px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-link {
    background-color: white; /* Цвет фона шапки */
    color: #111133;
    width: 5%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    text-decoration: none;
    cursor: pointer;
    border-radius: 5px;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 24px;
    border: 2px solid #111133; /* Добавляем белый бордюр толщиной 1px */
}

.nav-link:hover {
    background-color: #4848a78c; /* Немного темнее для эффекта наведения */
    border: 2px solid white; /* Убедимся, что бордюр остается при наведении */
}

.media-content {
    width: 90%;
    height: 100%;
    margin-left: 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.media-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
    border-radius: 8px;
}

.media-content video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.media-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

#load-more {
    margin: 20px auto;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: block;
}

#load-more:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: red;
    text-align: center;
    margin: 20px 0;
    display: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

#on-top-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: none;
}

#on-top-button.visible {
    display: block;
}