/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ===== ОСНОВНОЙ МАКЕТ ===== */
.app {
    display: flex;
    min-height: 100vh;
}

/* Сайдбар - навигация */
.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

/* Логотип */
.logo-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 4px solid #bc76f5;
    box-shadow: 0 0 15px rgba(188, 118, 245, 0.6);
    transition: all 0.3s ease;
}

.logo-placeholder:hover {
    box-shadow: 0 0 25px rgba(188, 118, 245, 0.8);
    transform: scale(1.05);
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
    padding: 0 20px;
}

.sidebar-section {
    padding: 0 20px;
    margin-bottom: 25px;
}

.sidebar-section h4 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 8px;
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    text-align: left;
}

.nav-link:hover {
    background: #e9e9e9;
}

.nav-link.active {
    background: #bc76f5;
    color: white;
}

/* Центрируем "Популярное сейчас" во всех версиях */
.sidebar-section h4 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
    text-align: center; /* ← добавляем центрирование */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 8px;
}

/* Основная область контента */
.content {
    flex: 1;
    margin-left: 250px;
    padding: 80px 20px 20px 20px;
}

.feed {
    max-width: 600px;
    margin: 0 auto;
}

/* ===== СТИЛИ ПОСТОВ ===== */
.post {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.post:hover {
    transform: translateY(-2px);
}

/* Текст поста */
.post-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Медиа-контент */
.post img,
.post video {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 15px;
}

.post video {
    background: #000;
}

/* ===== АДАПТИВНЫЙ РАЗМЕР МЕДИА ===== */
.media-container {
    width: 100%;
    max-width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-container video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
}

.media-container.vertical video {
    max-width: 400px;
    margin: 0 auto;
}

.media-container.vertical {
    background: transparent;
    text-align: center;
}

.post:has(.post-text:only-child) .media-container {
    display: none;
}

/* ===== СТИЛИ РЕАКЦИЙ ===== */
.reactions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reaction-btn {
    background: none;
    border: 1px solid #bdc3c7;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.reaction-btn:hover {
    background: #f0e6ff;
    transform: scale(1.05);
}

.reaction-btn.active {
    background: #bc76f5;
    color: white;
    border-color: #bc76f5;
}

/* Футер поста с реакциями и временем */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.post-time {
    font-size: 12px;
    color: #7f8c8d;
    margin-left: auto;
}

/* Блок репоста */
.post-share {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
    text-align: right;
}

.share-btn {
    background: none;
    border: 1px solid #bc76f5;
    color: #bc76f5;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: #bc76f5;
    color: white;
    transform: scale(1.05);
}

/* ===== ВЕРХНЯЯ НАВИГАЦИЯ ===== */
.top-navigation {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    z-index: 100;
    height: 60px;
    display: flex;
    align-items: center;
}

.top-tabs {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    align-items: center;
    width: 100%;
}

.top-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.top-tab.active {
    background: #bc76f5;
    color: white;
}

.top-tab:hover:not(.active) {
    background: #f8f9fa;
}

/* Выпадающий список категорий */
.categories-dropdown {
    position: relative;
    margin-left: auto;
}

.categories-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.categories-btn:hover {
    background: #f0e6ff;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    min-width: 280px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.categories-dropdown:hover .dropdown-content {
    display: block;
}

/* Элементы категорий в выпадающем списке */
.category-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 4px;
}

.category-item:hover {
    background: #f0e6ff;
}

.popular-categories h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #7f8c8d;
}

/* ===== КНОПКА МЕНЮ ===== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 101;
    background: #bc76f5;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: #a45ee3;
}

/* ===== АДАПТИВНОСТЬ ===== */
/* Большие планшеты и маленькие десктопы */
@media (max-width: 1200px) and (min-width: 769px) {
    .sidebar {
        width: 200px;
        padding: 15px 0;
    }
    
    .logo-placeholder {
        width: 65px;
        height: 65px;
        margin-bottom: 12px;
        border: 3px solid #bc76f5;
    }
    
    .logo {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .sidebar-section {
        padding: 0 12px;
        margin-bottom: 15px;
    }
    
    .sidebar-section h4 {
        font-size: 12px;
        margin-bottom: 8px;
        padding-bottom: 4px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .content {
        margin-left: 200px;
    }
    
    .top-navigation {
        left: 200px;
    }
}

/* Планшеты */
@media (max-width: 1024px) {
    .sidebar {
        width: 180px;
        padding: 12px 0;
    }
    
    .logo-placeholder {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
        border: 3px solid #bc76f5;
    }
    
    .logo {
        font-size: 1.1rem;
        margin-bottom: 15px;
        padding: 0 15px;
    }
    
    .sidebar-section {
        padding: 0 12px;
        margin-bottom: 15px;
    }
    
    .sidebar-section h4 {
        font-size: 12px;
        margin-bottom: 8px;
        padding-bottom: 4px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .content {
        margin-left: 180px;
    }
    
    .top-navigation {
        left: 180px;
    }
}

/* Телефоны */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }
    
    .menu-toggle {
        display: block;
        top: 50%;
        transform: translateY(-50%);
        left: 10px;
        padding: 8px 10px;
        z-index: 102;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .top-navigation {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 50px;
        margin-left: 0;
        display: flex;
        align-items: center;
    }
    
    .top-tabs {
        padding: 0 15px 0 50px;
        gap: 8px;
        display: flex;
        align-items: center;
        height: 100%;
    }
    
    .top-tab {
        padding: 6px 12px;
        font-size: 14px;
        white-space: nowrap;
        height: 32px;
        display: flex;
        align-items: center;
    }
    
    .categories-btn {
        padding: 6px 12px;
        font-size: 14px;
        white-space: nowrap;
        height: 32px;
        display: flex;
        align-items: center;
    }
    
    /* САЙДБАР - ОБНОВЛЕННЫЕ СТИЛИ */
    .sidebar {
        position: fixed;
        top: 50px;
        left: 0;
        height: auto;
        width: 100%;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        z-index: 99;
        padding: 20px;
        background: white;
        border-bottom: 1px solid #e0e0e0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        max-height: 80vh;
        overflow-y: auto;
        text-align: center;
    }
    
    .sidebar.active {
        transform: translateY(0);
    }
    
    .content {
        margin-left: 0;
        padding: 60px 15px 15px 15px;
    }

    .post {
        transform: scale(0.85);
        transform-origin: top center;
        margin-bottom: 10px;
    }
    
    .post:hover {
        transform: scale(0.85) !important;
    }
    
    .sidebar .logo-placeholder {
        width: 55px;
        height: 55px;
        margin: 0 auto 10px auto;
        border: 2px solid #bc76f5;
    }
    
    .sidebar .logo {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .sidebar-section {
        padding: 0;
        margin-bottom: 15px;
    }
    
    .sidebar-section h4 {
        font-size: 12px;
        margin-bottom: 10px;
        padding-bottom: 5px;
        text-align: center;
        margin: 0 auto 15px auto;
        max-width: 200px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .nav-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .nav-list .nav-link {
        width: 200px;
        text-align: center;
    }
    
    .dropdown-content {
        right: 0;
        left: 0;
        min-width: auto;
    }
    
    .post-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .post-time {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 500px) {
    .top-tabs {
        padding: 0 5px 0 40px;
        gap: 2px;
        overflow-x: auto;
    }
    
    .top-tab {
        padding: 3px 6px;
        font-size: 11px;
        height: 26px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .categories-btn {
        padding: 3px 6px;
        font-size: 11px;
        height: 26px;
        white-space: nowrap;
    }
    
    .menu-toggle {
        left: 5px;
        padding: 5px 7px;
        height: 26px;
        font-size: 13px;
    }
    
    .top-navigation {
        height: 40px;
    }
    
    .sidebar {
        top: 40px;
        padding: 12px;
    }
    
    .nav-list .nav-link {
        width: 160px;
        padding: 5px 8px;
        font-size: 12px;
    }

    .content {
        padding: 50px 8px 8px 8px;
        transform-origin: top center;
    }
    
    .post {
        transform: scale(0.85);
        transform-origin: top center;
        margin-bottom: 8px;
    }
    
    .post:hover {
        transform: scale(0.85) !important;
    }
    
    .sidebar .logo-placeholder {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
        border: 2px solid #bc76f5;
    }
    
    /* Фиксим выпадашку категорий */
    .dropdown-content {
        position: fixed;
        top: 40px !important;
        left: 5px !important;
        right: 5px !important;
        min-width: auto;
        max-height: 60vh;
        overflow-y: auto;
    }
}


/* Кнопка переключения темы */
.theme-toggle {
    background: none;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.theme-toggle:hover {
    background: #f0e6ff;
}

/* Темная тема */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --sidebar-bg: #2d2d2d;
    --card-bg: #3d3d3d;
    --border-color: #444444;
    --muted-text: #b0b0b0;
}

[data-theme="dark"] body {
    background: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .sidebar {
    background: var(--sidebar-bg);
    border-right-color: var(--border-color);
}

[data-theme="dark"] .post {
    background: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .top-navigation {
    background: var(--sidebar-bg);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .post-text {
    color: var(--text-color);
}

[data-theme="dark"] .post-time {
    color: var(--muted-text);
}

[data-theme="dark"] .sidebar-section h4 {
    color: var(--muted-text);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .nav-link {
    color: var(--text-color);
}

[data-theme="dark"] .nav-link:hover {
    background: #444444;
}

[data-theme="dark"] .top-tab {
    color: var(--text-color);
}

[data-theme="dark"] .top-tab:hover:not(.active) {
    background: #444444;
}

[data-theme="dark"] .categories-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .reaction-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .reaction-btn span {
    color: var(--text-color);
}

[data-theme="dark"] .share-btn {
    border-color: #bc76f5;
    color: #bc76f5;
}

[data-theme="dark"] .logo {
    color: var(--text-color);
}

[data-theme="dark"] .dropdown-content {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .category-item {
    color: var(--text-color);
}

[data-theme="dark"] .category-item:hover {
    background: #444444;
}

[data-theme="dark"] .share-btn:hover {
    background: #bc76f5;
    color: white; /* ← добавляем белый текст при ховере */
}

[data-theme="dark"] .reaction-btn.active {
    background: #bc76f5;
    color: white; /* ← белый текст для активной реакции */
    border-color: #bc76f5;
}

[data-theme="dark"] .reaction-btn.active span {
    color: white; /* ← белый цвет счетчика */
}

[data-theme="dark"] .nav-link.active {
    background: #bc76f5;
    color: white; /* ← белый текст для активной навигации */
}

[data-theme="dark"] .top-tab.active {
    background: #bc76f5;
    color: white; /* ← белый текст для активной вкладки */
}



/* Адаптивность для кнопки темы */
@media (max-width: 768px) {
    .theme-toggle {
        padding: 6px 10px;
        font-size: 14px;
        margin-left: 5px;
    }
}

@media (max-width: 500px) {
    .theme-toggle {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* ===== ИНДИКАТОР ЗАГРУЗКИ ===== */
.loader {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

/* Футер сайдбара */
.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.sidebar-footer .version {
    font-size: 12px;
    font-weight: bold;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.sidebar-footer .social-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.sidebar-footer .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #666;
}

.sidebar-footer .social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-footer .social-link.vk:hover {
    background: #4c75a3;
    color: white;
}

.sidebar-footer .social-link.telegram:hover {
    background: #0088cc;
    color: white;
}

/* Темная тема для футера сайдбара */
[data-theme="dark"] .sidebar-footer {
    border-top-color: #444444;
}

[data-theme="dark"] .sidebar-footer .version {
    color: #b0b0b0;
}

[data-theme="dark"] .sidebar-footer .social-link {
    background: #3d3d3d;
    color: #b0b0b0;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .sidebar-footer {
        padding: 15px;
    }
    
    .sidebar-footer .social-link {
        width: 28px;
        height: 28px;
    }
    
    .sidebar-footer .social-link svg {
        width: 14px;
        height: 14px;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 500px) {
    .sidebar-footer {
        padding: 12px;
    }
    
    .sidebar-footer .social-link {
        width: 26px;
        height: 26px;
    }
    
    .sidebar-footer .social-link svg {
        width: 12px;
        height: 12px;
    }
}

/* Стили для панели управления админки */
.admin-controls {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
}

.control-select, .control-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.control-input {
    min-width: 200px;
}

/* Стили для пагинации */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
}

.pagination-controls button {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination-controls button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.pagination-controls span {
    font-weight: bold;
    color: #2c3e50;
    margin: 0 10px;
}

.pagination-info {
    font-size: 14px;
    color: #6c757d;
}

/* Яндекс.Метрика в сайдбаре */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 20px; 
}

.sidebar-footer .yandex-metrika {
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.sidebar-footer .yandex-metrika:hover {
    opacity: 1;
}

.sidebar-footer .yandex-metrika img {
    border-radius: 4px;
}