/* ==========================================
   БАЗОВЫЕ СТИЛИ
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --bg: #f0f2f5;
    --white: #ffffff;
    --gray-100: #f5f5f5;
    --gray-200: #e0e0e0;
    --gray-300: #bdbdbd;
    --gray-600: #757575;
    --gray-800: #424242;
    --gray-900: #212121;
    --danger: #d32f2f;
    --success: #2e7d32;
    --warning: #f57c00;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.3s ease;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    line-height: 1.6;
    padding-top: 56px;
}

/* ==========================================
   ШАПКА
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header__container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header__menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-800);
    cursor: pointer;
    padding: 8px;
}

.header__logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.header__logo i {
    font-size: 22px;
}

.header__search {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.header__search form {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 24px;
    padding: 0 12px;
    transition: var(--transition);
}

.header__search form:focus-within {
    background: var(--white);
    box-shadow: 0 0 0 2px var(--primary);
}

.header__search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    color: var(--gray-900);
}

.header__search input::placeholder {
    color: var(--gray-600);
}

.header__search button {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
}

.header__search button:hover {
    color: var(--primary);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--primary-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item a {
    color: var(--gray-900);
    text-decoration: none;
}

.search-result-item .title {
    font-weight: 500;
}

.search-result-item .snippet {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

.header__user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    white-space: nowrap;
}

.user-name {
    color: var(--gray-800);
    font-weight: 500;
}

.user-name i {
    margin-right: 4px;
    color: var(--gray-600);
}

.user-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.user-badge.admin {
    background: #e8f5e9;
    color: var(--success);
}

.user-badge.reader {
    background: #fff3e0;
    color: var(--warning);
}

.logout-btn,
.login-btn {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 4px;
}

.logout-btn:hover {
    color: var(--danger);
    background: #ffebee;
}

.login-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ==========================================
   МЕНЮ
   ========================================== */
.menu {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.menu__header {
    display: none;
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    justify-content: space-between;
    align-items: center;
}

.menu__close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 4px 8px;
}

.menu__logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.menu__user {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu__user-avatar {
    font-size: 36px;
    color: var(--gray-600);
}

.menu__user-info {
    flex: 1;
}

.menu__user-name {
    font-weight: 600;
    font-size: 14px;
}

.menu__user-role {
    font-size: 12px;
    font-weight: 500;
}

.menu__user-role.admin {
    color: var(--success);
}

.menu__user-role.reader {
    color: var(--warning);
}

.menu__body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* ==========================================
   МЕНЮ - КОРНЕВОЙ СПИСОК
   ========================================== */
.menu__root {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ==========================================
   МЕНЮ - ПУНКТЫ
   ========================================== */
.menu__item {
    display: block;
    width: 100%;
    position: relative;
}

.menu__item--home {
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.menu__item--admin {
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 8px;
    padding-bottom: 4px;
}

.menu__item--admin .menu__link {
    color: var(--primary);
    font-weight: 500;
}

.menu__item--admin .menu__link i {
    color: var(--primary);
}

.menu__item--admin .menu__link:hover {
    background: var(--primary-light);
}

/* ==========================================
   МЕНЮ - ОБЕРТКА ПУНКТА
   ========================================== */
.menu__item-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding-right: 10px;
    position: relative;
}

/* ==========================================
   МЕНЮ - ССЫЛКИ
   ========================================== */
.menu__link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 16px;
    margin: 0;
    color: var(--gray-800);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    border-left: 3px solid transparent;
    min-width: 0;
}

.menu__link:hover {
    background: var(--gray-100);
    border-left-color: var(--primary);
}

.menu__link.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 500;
    color: var(--primary);
}

.menu__link i {
    width: 20px;
    color: var(--gray-600);
    flex-shrink: 0;
}

.menu__link.active i {
    color: var(--primary);
}

/* ==========================================
   МЕНЮ - СТРЕЛКА РАСКРЫТИЯ
   ========================================== */
.menu__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-left: 2px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--gray-600);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.menu__toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.menu__toggle.open {
    transform: rotate(90deg);
}

/* ==========================================
   МЕНЮ - КНОПКИ УПРАВЛЕНИЯ
   ========================================== */
.menu__controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.menu__item:hover .menu__controls {
    opacity: 1;
}

.menu__ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--gray-600);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.menu__ctrl-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.menu__ctrl-btn--edit:hover {
    background: #e0e7ff;
    color: #4f46e5;
}

.menu__ctrl-btn--delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* ==========================================
   МЕНЮ - ПОДРАЗДЕЛЫ
   ========================================== */

/* Контейнер для подразделов - вынесен ЗА flex, поэтому просто блок */
.tree-container {
    display: none;
    width: 100%;
    clear: both;
}

.tree-container.open {
    display: block;
}

/* Список подразделов */
.menu__sub {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 16px;
}

/* Элементы подразделов */
.menu__sub .menu__item {
    display: block;
    width: 100%;
}

.menu__sub .menu__item-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    padding-right: 10px;
    padding-left: 8px;
}

.menu__sub .menu__link {
    flex: 1;
    padding: 6px 12px 6px 16px;
    font-size: 13px;
    color: var(--gray-600);
    text-decoration: none;
    border-left: 3px solid transparent;
    display: block;
}

.menu__sub .menu__link:hover {
    color: var(--gray-900);
    background: var(--gray-100);
    border-left-color: var(--primary);
}

.menu__sub .menu__link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
}

/* Третий уровень вложенности */
.menu__sub .menu__sub {
    padding-left: 16px;
}

.menu__sub .menu__sub .menu__link {
    font-size: 13px;
    color: var(--gray-500);
}

.menu__sub .menu__sub .menu__link:hover {
    color: var(--gray-700);
}

/* ==========================================
   МЕНЮ - ПУНКТ "ГЛАВНАЯ"
   ========================================== */
.menu__item--home .menu__item-wrapper {
    padding-right: 10px;
}

.menu__item--home .menu__link i {
    color: var(--primary);
}

.menu__item--home .tree-container .menu__link {
    padding-left: 44px;
    font-size: 14px;
}

.menu__item--home .tree-container .menu__link i {
    width: 18px;
    font-size: 13px;
    color: var(--gray-500);
}

.menu__item--home .tree-container .menu__link:hover i {
    color: var(--primary);
}

/* ==========================================
   МЕНЮ - ПОДВАЛ
   ========================================== */
.menu__footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-200);
    font-size: 12px;
    color: var(--gray-600);
    text-align: center;
    background: #f9fafb;
    margin: 8px 12px;
    border-radius: 10px;
}

.menu__version {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.test-badge {
    background: #ff6f00;
    color: white;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
/* ==========================================
   ОСНОВНОЙ КОНТЕНТ
   ========================================== */
.main-content {
    margin-left: 280px;
    padding: 24px 32px 80px;
    max-width: 1200px;
    min-height: calc(100vh - 56px);
}

/* ==========================================
   СТРАНИЦЫ
   ========================================== */
.page-content {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.page-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--gray-800);
}

.page-content p {
    margin-bottom: 12px;
    color: var(--gray-800);
}

.page-content .divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 24px 0;
}

/* ==========================================
   СТАТЬИ
   ========================================== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-item {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.article-item:hover {
    box-shadow: var(--shadow-hover);
    border-left-color: var(--primary);
}

.article-item__title {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.article-item__title:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.article-item__actions {
    display: flex;
    gap: 8px;
}

.article-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-600);
}

.article-empty i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
    display: block;
}

/* ==========================================
   СТАТЬЯ (ПРОСМОТР)
   ========================================== */
.article-view h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: var(--gray-600);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta i {
    color: var(--gray-400);
}

.article-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--gray-800);
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    margin: 16px 0;
}

/* ==========================================
   СТРАНИЦА ВХОДА
   ========================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
}

.login-box {
    background: #ffffff;
    padding: 48px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    max-width: 420px;
    width: 100%;
    border: 1px solid #e8ecf0;
}

.login-box h1 {
    text-align: center;
    font-size: 26px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.login-box .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.login-box .form-control:focus {
    border-color: #4f46e5;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.login-box .checkbox {
    margin: 8px 0 24px;
}

.login-box .checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.login-box .checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #4f46e5;
    cursor: pointer;
    margin: 0;
}

.login-box .btn-primary {
    width: 100%;
    padding: 14px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.login-box .btn-primary:hover {
    background: #4338ca;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.login-footer .test-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ==========================================
   МОДАЛЬНОЕ ОКНО
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal__body {
    padding: 24px;
}

.modal__body .form-group {
    margin-bottom: 16px;
}

.modal__body .form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.modal__body .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.modal__body .form-control:focus {
    border-color: #4f46e5;
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.modal__error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.modal__error.active {
    display: block;
}

/* ==========================================
   АДАПТИВ
   ========================================== */
@media (max-width: 768px) {
    .header__menu-btn {
        display: block;
    }
    
    .menu {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .menu.open {
        transform: translateX(0);
    }
    
    .menu__header {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .login-box {
        padding: 32px 24px;
    }
    
    .login-box h1 {
        font-size: 22px;
    }
    
    .menu__controls {
        opacity: 1;
    }
    
    .menu__ctrl-btn {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
}

/* ==========================================
   СОВМЕСТИМОСТЬ СО СТАРЫМИ КЛАССАМИ
   ========================================== */
.MenuList {
    position: relative;
    padding: 4px 0;
}

.MenuList:hover {
    background: var(--gray-50);
}

.BorderList {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 16px;
}

.openTree {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 14px;
    border: none;
    background: transparent;
    transition: var(--transition);
    border-radius: 4px;
}

.openTree:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.writeButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 14px;
    transition: var(--transition);
    border-radius: 4px;
}

.writeButton:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.showFuncMenu {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    background: var(--white);
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--gray-200);
    z-index: 100;
}

.imagesBlock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
}

.imagesBlock:hover {
    background: var(--gray-100);
}

.alink {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.alink:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==========================================
   ПРАВИЛЬНАЯ ВЛОЖЕННОСТЬ МЕНЮ
   ========================================== */

/* Корневой список */
.menu__root {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Список подразделов - скрыт по умолчанию */
.menu__sub {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 16px; /* Отступ для вложенности */
    /*display: none;*/
}

/* Когда подраздел открыт */
.menu__sub.active {
    display: block;
}

/* Когда подраздел открыт через style (из AJAX) */
.menu__sub[style*="display:block"] {
    display: block !important;
}

/* Элемент подраздела */
.menu__sub .menu__item {
    display: block;
    width: 100%;
}

.menu__sub .menu__item-wrapper {
    padding-left: 8px;
    padding-right: 10px;
}

.menu__sub .menu__link {
    padding: 6px 12px 6px 16px;
    font-size: 13px;
    color: var(--gray-600);
    border-left: 3px solid transparent;
}

.menu__sub .menu__link:hover {
    color: var(--gray-900);
    border-left-color: var(--primary);
}

.menu__sub .menu__link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
}

/* Третий уровень вложенности */
.menu__sub .menu__sub {
    padding-left: 16px;
}

.menu__sub .menu__sub .menu__link {
    font-size: 13px;
    color: var(--gray-500);
}

.menu__sub .menu__sub .menu__link:hover {
    color: var(--gray-700);
}

.menu__sub .menu__sub .menu__link.active {
    color: var(--primary);
}

/* ==========================================
   ВЫДЕЛЕНИЕ РАСКРЫТЫХ ПОДМЕНЮ
   ========================================== */

/* Подсветка родительского пункта, у которого открыто подменю */
.menu__item.has-children > .menu__item-wrapper {
    transition: background 0.2s ease;
}

.menu__item.has-children > .menu__item-wrapper:has(+ .tree-container.open) {
    background: var(--primary-light);
    border-radius: 4px;
}

/* Или через класс active-parent, который можно добавить через JS */
.menu__item.has-children.active-parent > .menu__item-wrapper {
    background: var(--primary-light);
    border-radius: 4px;
}

.menu__item.has-children.active-parent > .menu__item-wrapper .menu__link {
    color: var(--primary);
    font-weight: 500;
}

/* Подсветка самих подпунктов */
.tree-container.open .menu__sub {
    background: #f8f9fa;
    border-radius: 4px;
    margin: 2px 8px 2px 16px;
    padding: 4px 0;
    border-left: 2px solid var(--primary);
}

/* Каждый пункт подменю при наведении */
.tree-container.open .menu__sub .menu__item:hover {
    background: var(--gray-100);
    border-radius: 4px;
}

/* Активный пункт подменю */
.tree-container.open .menu__sub .menu__link.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 500;
    color: var(--primary);
    border-radius: 0 4px 4px 0;
}

/* Легкая анимация появления */
.tree-container.open {
    animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Иконка-индикатор открытого подменю */
.menu__toggle.open {
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 4px;
}

/* ==========================================
   ВЫДЕЛЕНИЕ ДЛЯ ГЛАВНОЙ
   ========================================== */

.menu__item--home .tree-container.open .menu__sub {
    background: #f8f9fa;
    border-radius: 4px;
    margin: 2px 8px 2px 16px;
    padding: 4px 0;
    border-left: 2px solid var(--primary);
}

.menu__item--home .tree-container.open .menu__sub .menu__link {
    padding-left: 48px;
}

.menu__item--home .tree-container.open .menu__sub .menu__link:hover {
    background: var(--gray-100);
    border-radius: 4px;
}

/* ==========================================
   СТРЕЛКА-ИНДИКАТОР
   ========================================== */

/* Маленький индикатор рядом со стрелкой, показывающий что подменю открыто */
.menu__toggle.open::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-left: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}



/* ==========================================
   КНОПКИ
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b71c1c;
    color: #fff;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-block {
    display: flex;
    justify-content: center;
    width: 100%;
}

.article-actions .btn {
    padding: 10px 20px;
}

.section-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

#editor {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px;
    min-height: 300px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

select.form-control {
    appearance: auto;
}

/* ==========================================
   АЛЕРТЫ
   ========================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* ==========================================
   ПОИСК
   ========================================== */

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    border: 1px solid var(--gray-200);
}

.search-results.active {
    display: block;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}
.search-results::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 0 0 var(--radius) var(--radius);
}
.search-results::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

.search-result-empty {
    padding: 20px;
    text-align: center;
    color: var(--gray-600);
    font-size: 14px;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--primary-light);
}

.search-result-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.search-result-title {
    font-weight: 500;
    color: var(--gray-900);
    font-size: 14px;
    margin-bottom: 4px;
}

.search-result-meta {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-query {
    background: var(--gray-100);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 8px;
}
.search-query p {
    margin: 4px 0;
}
.search-empty {
    text-align: center;
    padding: 40px 20px;
}
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.search-result-full {
    background: var(--white);
    padding: 20px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}
.search-result-full:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}
.search-result-full-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.search-result-full-title:hover {
    text-decoration: underline;
}
.search-result-full-snippet {
    margin: 8px 0 12px;
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.6;
}
.search-result-full-snippet mark,
.search-result-title mark,
.search-result-snippet mark {
    background: #fff3cd;
    padding: 1px 4px;
    border-radius: 2px;
}
.search-result-full-meta {
    font-size: 13px;
    color: var(--gray-600);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.search-result-full-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================== */

@media (max-width: 768px) {
    /* Бургер-меню */
    .header__menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 24px;
        color: var(--gray-800);
        cursor: pointer;
        padding: 8px;
        line-height: 1;
    }
    
    /* Скрываем логотип на мобильных (он будет в меню) */
    .header__logo {
        display: none !important;
    }
    
    /* Скрываем имя пользователя на мобильных */
    .user-name {
        display: none !important;
    }
    
    /* Скрываем бейдж на мобильных */
    .user-badge {
        display: none !important;
    }
    
    /* Меню скрыто за экраном */
    .menu {
        transform: translateX(-100%);
        width: 300px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 20px rgba(0,0,0,0.15);
    }
    
    .menu.open {
        transform: translateX(0);
    }
    
    /* Шапка меню на мобильных */
    .menu__header {
        display: flex !important;
        padding: 16px 20px;
        background: var(--primary);
        color: #fff;
        align-items: center;
        justify-content: space-between;
    }
    
    .menu__header .menu__logo a {
        color: #fff;
    }
    
    .menu__close {
        color: #fff;
        font-size: 24px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px 8px;
    }
    
    .menu__close:hover {
        background: rgba(255,255,255,0.1);
        border-radius: 4px;
    }
    
    /* Оверлей для затемнения фона */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 998;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    /* Основной контент */
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .page-content h1 {
        font-size: 22px;
    }
    
    /* Увеличиваем область клика по элементам меню */
    .menu__link {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .menu__toggle {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .menu__ctrl-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .menu__controls {
        opacity: 1;
    }
    
    /* Поиск на мобильных */
    .header__search {
        max-width: 100%;
        flex: 1;
    }
    
    .header__search input {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .header__container {
        padding: 0 12px;
        gap: 8px;
    }
    
    /* Результаты поиска */
    .search-results {
        max-height: 300px;
    }
    
    .search-result-item {
        padding: 10px 14px;
    }
    
    /* Кнопки действий в статье */
    .article-actions {
        flex-wrap: wrap;
    }
    
    .article-actions .btn {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }
}

/* ==========================================
   AJAX ИНДИКАТОР ЗАГРУЗКИ
   ========================================== */

.ajax-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.ajax-loader.active {
    display: flex;
}

.ajax-loader__spinner {
    background: var(--white);
    padding: 30px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    text-align: center;
    animation: loaderFadeIn 0.3s ease;
}

@keyframes loaderFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ajax-loader__spinner span {
    display: block;
    margin-top: 12px;
    color: var(--gray-600);
    font-size: 14px;
}

/* Спиннер */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Мини-индикатор для кнопок */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Индикатор в меню при раскрытии */
.menu__toggle.loading {
    pointer-events: none;
    opacity: 0.5;
}

.menu__toggle.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 4px;
    vertical-align: middle;
}

/* ==========================================
   ПОДВАЛ
   ========================================== */

.footer {
    margin-left: 280px;
    padding: 20px 32px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    font-size: 13px;
    color: var(--gray-600);
}

.footer__container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer__info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer__info p {
    margin: 0;
}

.footer__version {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer__links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer__link {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer__link:hover {
    color: var(--primary);
}

/* ==========================================
   ПОДВАЛ - МОБИЛЬНАЯ ВЕРСИЯ
   ========================================== */

@media (max-width: 768px) {
    .footer {
        margin-left: 0;
        padding: 16px;
    }
    
    .footer__container {
        flex-direction: column;
        text-align: center;
    }
    
    .footer__info {
        justify-content: center;
    }
    
    .footer__links {
        justify-content: center;
    }
}

/* Кнопка "Добавить подраздел" */
.menu__ctrl-btn--add {
    color: var(--gray-600);
    font-size: 14px;
}

.menu__ctrl-btn--add:hover {
    background: #d1fae5;
    color: #059669;
}

/* ==========================================
   УПРАВЛЕНИЕ ФАЙЛАМИ
   ========================================== */

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.files-header h1 {
    margin: 0;
}

.files-search {
    margin-bottom: 20px;
}

.files-search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.files-search-form .form-control {
    width: 200px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.file-item {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.file-item:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.file-item-checkbox {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
}

.file-item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.file-item-thumb {
    width: 100%;
    height: 140px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.file-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-item-video {
    position: relative;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    transition: var(--transition);
}

.file-item-video:hover .file-item-play {
    background: rgba(0,0,0,0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.file-item-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    font-size: 32px;
}

.file-item-ext {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-top: 4px;
}

.file-item-info {
    padding: 10px 12px;
}

.file-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-meta {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--gray-600);
}

.file-item-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-item-type {
    text-transform: uppercase;
    background: var(--gray-100);
    padding: 0 6px;
    border-radius: 4px;
}

.file-item-actions {
    display: flex;
    gap: 4px;
    padding: 6px 12px 12px;
    border-top: 1px solid var(--gray-100);
}

.file-item-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 4px 8px;
}

/* Массовые действия */
.files-bulk-actions {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.files-bulk-actions label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

#selectedBbcode {
    width: 100%;
}

#selectedBbcode .form-control {
    width: 100%;
    font-size: 13px;
    font-family: monospace;
}

/* Пустая страница */
.files-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.files-empty i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
    display: block;
}

.files-empty p {
    font-size: 18px;
    margin: 0;
}

.files-empty-hint {
    font-size: 14px !important;
    color: var(--gray-500);
    margin-top: 8px !important;
}

/* Пагинация */
.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 16px 0;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.pagination-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Уведомления */
.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 9999;
    box-shadow: var(--shadow-hover);
    animation: notificationIn 0.3s ease;
}

@keyframes notificationIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==========================================
   АДАПТИВ ДЛЯ ФАЙЛОВ
   ========================================== */

@media (max-width: 768px) {
    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .file-item-thumb {
        height: 100px;
    }
    
    .files-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .files-search-form .form-control {
        width: 100%;
    }
    
    .files-bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .files-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

.pagination {
padding-left: 5px;
background: #fff;
border-radius: 2px;
box-shadow: 0 1px 0 0 #d7d8db, 0 0 0 1px #e3e4e8;
padding-top:15px;
padding-bottom:15px;
}

.paginate {
font-family:Arial, Helvetica, sans-serif;
    padding: 3px;
    margin: 3px;
}

.paginate_str {
    padding:2px 5px 2px 5px;
    margin:2px;
    border:1px solid #999;
    border-radius: 3px;
    text-decoration:none;
    color: #666;
}

.paginate_str:active {
    border: 1px solid #999;
    color: #000;
}



.paginate span.current {
    margin: 2px;
    padding: 2px 5px 2px 5px;
        border: 1px solid #999;
         border-radius: 3px;
        font-weight: bold;
        background: #2793e6;

        color: #FFF;
    }
    .paginate span.disabled {
        padding:2px 5px 2px 5px;
        margin:2px;
        border:1px solid #eee;
        border-radius: 3px;
        color:#DDD;
    }

.paginate_str:hover {
   color: #000;
    background-color: #999;

    }

/* ==========================================
   МОДАЛЬНОЕ ОКНО
   ========================================== */

.popup__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup__overlay.active {
    display: flex;
    opacity: 1;
}

.popup {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    min-width: 300px;
    padding: 40px 32px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
    overflow: auto;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup__close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #999;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.popup__close:hover {
    background: #f5f5f5;
    color: #333;
}

.popup__close:active {
    transform: scale(0.9);
}

#okno {
    padding: 0;
    width: 100%;
    min-height: 50px;
    max-height: 80vh;
    overflow: auto;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .popup {
        min-width: auto;
        width: 95vw;
        padding: 32px 20px 20px;
        max-height: 95vh;
    }
    
    .popup__close {
        top: 8px;
        right: 12px;
        font-size: 18px;
    }
    
    #okno {
        max-height: 85vh;
    }
}

/* Контейнер видео */
.ImageShow {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.ImageShowShadow {
    border-radius: 5px;
    box-shadow: -4px 4px 21px -3px #000;
}

/* Адаптивный видео контейнер */
.embed-responsive {
    position: relative;
    display: block;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.embed-responsive .embed-responsive-item,
.embed-responsive embed,
.embed-responsive iframe,
.embed-responsive object,
.embed-responsive video {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.mobileVideo {
    padding-bottom: 56.25%;
}

/* Кнопка воспроизведения */
.page_gif_play_icon {
    position: absolute;
    border-radius: 50%;
    will-change: opacity;
    top: 50%;
    left: 50%;
    margin-left: -25px;
    margin-top: -25px;
    height: 50px;
    width: 50px;
    background: #000;
    background: url(/images/video_play_small.png?1) 19px 13px no-repeat rgba(0,0,0,.5);
    -o-transition: background-color .1s linear;
    transition: background-color .1s linear;
}

/* Кнопка остановки/поделиться */
.buttonForVideo {
    position: absolute;
    border-radius: 50%;
    will-change: opacity;
    right: 0;
    left: 5px;
    z-index: 9999;
    cursor: pointer;
    height: 40px;
    width: 40px;
    background: url(/images/video_stop_small.png) 50% 50% no-repeat rgba(0,0,0,.5);
    -o-transition: background-color .1s linear;
    transition: background-color .1s linear;
    border: #fff dotted 2px;
}

/* Лейбл с информацией о файле */
.post_doc_thumb_label {
    font-family: Trebuchet MS,Helvetica,sans-serif;
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 23px;
    border-radius: 3px;
    overflow: hidden;
    text-align: left;
    pointer-events: none;
}

.post_doc_thumb_label:before {
    content: '';
    display: inline-block;
    height: 23px;
    width: 1px;
}

.post_doc_thumb_label_content {
    padding: 0 7px;
    border-radius: 3px 0 0 3px;
    background: rgba(0,0,0,.4);
    text-transform: uppercase;
    pointer-events: none;
    color: #fff;
    font-size: 12.5px;
    line-height: 23px;
    height: 23px;
    vertical-align: top;
}

.post_doc_thumb_label_content .divider:before {
    color: #fff;
    vertical-align: unset;
}

.post_doc_thumb_label_content:first-child {
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post_doc_thumb_label_content+.post_doc_thumb_label_content {
    border-radius: 0;
}

.post_doc_thumb_label_content+.post_doc_thumb_label_content .divider:first-child {
    margin-left: 0;
}

/* Прогресс-бар загрузки */
.page_gif_progress_icon {
    width: 60px;
    height: 60px;
    opacity: .85 !important;
    filter: alpha(opacity=85) !important;
    margin-left: -30px;
    margin-top: -30px;
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
}

/* Анимация загрузки */
.load {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 50px;
    height: 50px;
}

.load hr {
    position: absolute;
    border: 0;
    margin: 0;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    animation: spin 2s ease infinite;
}

.load :first-child {
    background: #19a68c;
    animation-delay: -1.5s;
}

.load :nth-child(2) {
    background: #f63d3a;
    animation-delay: -1s;
}

.load :nth-child(3) {
    background: #fda543;
    animation-delay: -.5s;
}

.load :last-child {
    background: #193b48;
}

@keyframes spin {
    0%,100% {
        transform: translate(0);
    }
    25% {
        transform: translate(160%);
    }
    50% {
        transform: translate(160%,160%);
    }
    75% {
        transform: translate(0,160%);
    }
}

/* Кнопка копирования ссылки */
.copyresl {
    border-radius: 2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: absolute;
    pointer-events: none;
    text-transform: uppercase;
    display: none;
    z-index: 9999;
    right: 0;
    left: 50px;
    top: 15px;
    width: 120px;
    background: rgba(0,0,0,.5);
    padding: 4px 7px 5px;
    color: #fff;
    color: hsla(0,0%,100%,.8);
    font-weight: 700;
    -o-transition: opacity .2s;
    transition: opacity .2s;
}

/* Display утилиты */
.display_inline {
    display: inline-block;
}

.display_none {
    display: none;
}