/* Глобальный фон страницы */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    font-family: Arial, sans-serif;
}

.global-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e url('') center/cover no-repeat;
    z-index: -2;
}

.global-bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

/* Заголовок сайта */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    color: white;
    padding: 10px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-header .header-left {
    flex: 0 0 auto;
}
.site-header .header-center {
    flex: 1;
    text-align: center;
}
.site-header .header-right {
    flex: 0 0 auto;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.site-header .header-right a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}
.site-header .header-right a:hover {
    text-decoration: underline;
}
.site-header h1 {
    margin: 0;
    font-size: 24px;
}

/* Контейнер для горизонтального скролла */
.scroll-container {
    display: flex;
    flex-wrap: nowrap;
    height: 100vh;
    padding-top: 70px;
    padding-bottom: 90px;
    padding-left: 5%;
    padding-right: 15%;
    scroll-padding: 20%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}

/* Каждая тема – по центру */
.theme-slide {
    flex: 0 0 90%;
    height: 78vh;
    max-width: 1000px;
    max-height: 800px;
    margin: 0 15px;
    scroll-snap-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    flex-shrink: 0;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    padding-top: 20px;
    padding-bottom: 20px;
}
.theme-slide:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.theme-title {
    font-size: 28px;
    margin: -10px 0 15px 0;
    z-index: 1;
    text-align: center;
    font-weight: 900;
}
.theme-date {
    font-size: 16px;
    z-index: 1;
}

/* Блоки вертикально */
.blocks-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 0 10px;
    width: 100%;
    max-width: 900px;
    align-items: center;
}

/* Каждый блок */
.block-card {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 14px;
    padding: 0;
    width: 100%;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.1);
    min-height: 160px;
    overflow: hidden;
    position: relative;
}

.block-card:hover {
    transform: scale(1.04);
    box-shadow: 0 0 30px rgba(255,255,255,0.25);
}

/* Затемнение и контейнер для контента */
.block-overlay {
    background: rgba(0,0,0,0.3);
    padding: 10px 16px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    min-height: 80px;
}

/* Контентная часть */
.block-content {
    flex: 1;
    min-width: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.block-card h3 {
    font-size: 15px;
    margin: 0 0 4px 0;
    color: #fff;
    text-align: center;
    font-weight: 900;
}

.block-preview {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 auto;
    color: #ddd;
    line-height: 1.4;
    text-align: center;
    font-weight: 700;
    height: 30px;
}
/* Иконки внизу */
.block-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-shrink: 0;
    margin-top: 8px;
    width: 100%;
}

.icon {
    font-size: 18px;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    padding: 4px;
    transition: 0.3s;
    display: inline-block;
    line-height: 1;
}
.icon:hover {
    background: rgba(255,255,255,0.6);
}

/* Иконки темы (нижний правый угол) */
.theme-icons {
    position: absolute;
    bottom: 15px;
    right: 20px;
    z-index: 2;
    display: flex;
    gap: 10px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    overflow-y: auto;
}
.modal-content {
    background: white;
    padding: 25px;
    width: 80%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 15px;
    position: relative;
    color: black;
    text-shadow: none;
    animation: slideUp 0.4s ease-out;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow-y: auto;
}
@keyframes slideUp {
    from {
        transform: translateY(40px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
.close, .close-media {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}
.close:hover, .close-media:hover {
    color: #000;
}
#modal-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
}
#modal-text {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.6;
}
#media-player video, #media-player audio {
    width: 100%;
    border-radius: 8px;
}
#subscribe-btn {
    padding: 12px 25px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}
#subscribe-btn:hover {
    background: #218838;
}

/* Архивные темы — настройки из админки */
.theme-slide.archive-theme {
    opacity: 0.85;
    filter: saturate(0.8);
}
.theme-slide.archive-theme .theme-title {
    color: #ffd700;
}

/* Футер */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    color: #fff;
    text-align: center;
    padding: 8px 20px;
    box-sizing: border-box;
    font-size: 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.site-footer .footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.site-footer .footer-social a {
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}
.site-footer .footer-social a:hover {
    color: #ffd700;
    transform: scale(1.3);
}
.site-footer .footer-text {
    font-size: 12px;
    opacity: 0.8;
}
.site-footer .footer-text a {
    color: #fff;
    text-decoration: underline;
}
.site-footer .footer-text a:hover {
    color: #ffd700;
}

/* === КНОПКИ В ХЕДЕРЕ — ЭФФЕКТ УВЕЛИЧЕНИЯ === */
.btn-login,
.btn-logout,
.btn-admin {
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-block;
    border-radius: 5px;
    padding: 6px 15px;
    text-decoration: none;
    font-weight: 600;
}

.btn-login:hover,
.btn-logout:hover,
.btn-admin:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(255,255,255,0.3);
}

/* Ссылка на профиль (имя пользователя) */
.header-right a[href*="profile"] {
    transition: transform 0.3s;
    display: inline-block;
    font-weight: 600;
}

.header-right a[href*="profile"]:hover {
    transform: scale(1.05);
}

/* === СТИЛИ ДЛЯ АВТОРИЗАЦИИ === */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 30px;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    color: #333;
    text-shadow: none;
}
.auth-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #222;
}
.auth-container input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
}
.auth-container button {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}
.auth-container button:hover {
    background: #218838;
}
.auth-container p {
    text-align: center;
    margin-top: 15px;
}
.auth-container a {
    color: #007bff;
    text-decoration: none;
}
.auth-container a:hover {
    text-decoration: underline;
}
.flash {
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}
.flash.success {
    background: #d4edda;
    color: #155724;
}
.flash.danger {
    background: #f8d7da;
    color: #721c24;
}
.flash.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* === АДМИН-ПАНЕЛЬ === */
.admin-container {
    max-width: 800px;
    margin: 80px auto;
    padding: 30px;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    color: #333;
    text-shadow: none;
}
.admin-container h1 {
    text-align: center;
}
.admin-container a {
    color: #007bff;
    text-decoration: none;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 768px) {
    /* === УЖЕ ХЕДЕР === */
    .site-header {
        padding: 1,5px 6px;          /* ← добавить: уменьшить отступы */
        flex-wrap: wrap;
        gap: 2px;                   /* ← было 5px → стало 3px */
    }
    .site-header .header-center {
        flex: 1 1 100%;
        order: -1;
    }
    .site-header .header-right {
        flex: 1;
        justify-content: center;
        gap: 3px;                   /* ← было 8px → стало 5px */
    }
    .site-header .header-right a {
        font-size: 10px;            /* ← было 12px → стало 11px */
        padding: 1px 4px;           /* ← было 4px 10px → стало меньше */
    }
    .site-title {
        font-size: 10px;            /* ← добавить: уменьшить размер названия */
        margin: 0;
    }
    /* остальные стили без изменений */
    .theme-slide {
        flex: 0 0 85%;
        height: 70vh;
        margin: 0 10px;
    }
    .blocks-wrapper {
        width: 95%;
        max-width: 400px;
        padding: 0 10px;
    }
    .block-card {
        min-height: 120px;
    }
    .block-overlay {
        padding: 15px 18px;
        min-height: 120px;
    }
    .block-card h3 {
        font-size: 16px;
    }
    .block-preview {
        font-size: 12px;
        -webkit-line-clamp: 2;
        height: 40px;
    }
    .icon {
        font-size: 20px;
        padding: 4px;
    }
    .site-footer .footer-social {
        gap: 12px;
    }
    .site-footer .footer-social a {
        font-size: 16px;
    }
    .site-footer .footer-text {
        font-size: 10px;
    }
    .modal-content {
        width: 95%;
        max-height: 95vh;
        padding: 15px;
    }
    #modal-image {
        max-height: 250px;
    }
    #modal-text {
        font-size: 14px;
        max-height: 200px;
    }
}