.theme-loading,
.theme-loading *,
.theme-loading *::before,
.theme-loading *::after {
    transition: none !important;
    animation: none !important;
}

:root {
    --body-bg: #ffffff;
    --header-bg: #ffffff;
    --sidebar-bg: #f8f9fa;
    --post-bg: #ffffff;
    --post-border: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --button-primary-bg: #007bff;
    --button-primary-text: #ffffff;
    --button-secondary-bg: #6c757d;
    --link-color: #007bff;
    --accent-color: #17a2b8;
    --accent-color-rgb: 23, 162, 184;
    --error-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --modal-bg: #ffffff;
    --modal-overlay: rgba(0,0,0,0.5);
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --navbar-text: #495057;
    --footer-bg: #2d3436;
    --footer-text: #ffffff;
    --footer-border: rgba(255,255,255,0.1);
    --footer-text-secondary: rgba(255,255,255,0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--body-bg);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
}

p, span, div, a, label, h1, h2, h3, h4, h5, h6, 
li, td, th, blockquote, pre, code {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.brand-name,
.btn,
button,
[type="button"],
[type="submit"],
[type="reset"],
[onclick],
.no-wrap,
[data-no-wrap] {
    word-break: normal;
    overflow-wrap: normal;
    white-space: nowrap;
}

/* Контейнер для header (расширенный) */
.site-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Общий контейнер для страниц */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--post-border);
    transition: all 0.3s ease;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 3rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

/* Логотип */
.brand-logo {
    flex-shrink: 0;
}

.brand-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-name {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Навигация */
.header-navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: flex-end;
}

/* Группа кнопок действий */
.nav-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Кнопки действий */
.nav-action-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    height: 42px;
    white-space: nowrap;
}

.nav-action-link:hover {
    background: var(--sidebar-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-action-link svg {
    flex-shrink: 0;
}

.nav-action-label {
    display: none;
}

/* Кнопка уведомлений */
.notification-btn {
    position: relative;
}

/* Счетчик уведомлений */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--error-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.notification-badge.mobile {
    position: static;
    margin-left: auto;
}

/* Группа настроек */
.nav-settings-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
    height: 42px;
}

.dropdown-toggle:hover {
    background: var(--sidebar-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dropdown-text {
    display: none;
}

@media (min-width: 768px) {
    .dropdown-text {
        display: inline;
    }
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--post-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    padding: 0.5rem;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border-radius: 10px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--sidebar-bg);
    transform: translateX(4px);
}

.dropdown-item.active {
    background: var(--sidebar-bg);
    color: var(--accent-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--post-border);
    margin: 0.5rem 0;
}

/* Dropdown поиска */
.search-dropdown .dropdown-menu {
    min-width: 220px;
}

.search-dropdown .dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================
   УНИКАЛЬНЫЕ DROPDOWN ДЛЯ HEADER (ПРЕФИКС unic-)
   ============================================ */

/* Уникальный Dropdown */
.unic-dropdown {
    position: relative;
}

.unic-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
    height: 42px;
}

.unic-dropdown-toggle:hover {
    background: var(--sidebar-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.unic-dropdown-text {
    display: none;
}

.unic-dropdown-arrow {
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.unic-dropdown.active .unic-dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.unic-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--post-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    padding: 0.5rem;
}

.unic-dropdown.active .unic-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.unic-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border-radius: 10px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
}

.unic-dropdown-item:hover {
    background: var(--sidebar-bg);
    transform: translateX(4px);
}

.unic-dropdown-item.active {
    background: var(--sidebar-bg);
    color: var(--accent-color);
}

.unic-dropdown-divider {
    height: 1px;
    background: var(--post-border);
    margin: 0.5rem 0;
}

/* Превью темы в уникальном dropdown */
.unic-dropdown-menu.theme-menu {
    min-width: 320px;
    max-height: 420px !important;
    overflow-y: auto !important;
    overflow-x: hidden;
}

.unic-dropdown-menu.theme-menu::-webkit-scrollbar {
    width: 6px;
}

.unic-dropdown-menu.theme-menu::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    border-radius: 0 10px 10px 0;
}

.unic-dropdown-menu.theme-menu::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 3px;
}

.unic-dropdown-menu.theme-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.unic-dropdown-menu.theme-menu {
    scrollbar-width: thin;
    scrollbar-color: var(--input-border) var(--sidebar-bg);
}

/* Nav dropdown для медиа/общения */
.nav-dropdown.unic-dropdown .unic-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-dropdown.unic-dropdown .unic-dropdown-menu {
    min-width: 220px;
}

.nav-dropdown.unic-dropdown .unic-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-dropdown.unic-dropdown .unic-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Флаги */
.flag {
    width: 24px;
    height: 18px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.flag-en {
    background: linear-gradient(180deg, 
        #B22234 0%, #B22234 7.7%, 
        #FFFFFF 7.7%, #FFFFFF 15.4%,
        #B22234 15.4%, #B22234 23.1%,
        #FFFFFF 23.1%, #FFFFFF 30.8%,
        #B22234 30.8%, #B22234 38.5%,
        #FFFFFF 38.5%, #FFFFFF 46.2%,
        #B22234 46.2%, #B22234 53.9%,
        #FFFFFF 53.9%, #FFFFFF 61.6%,
        #B22234 61.6%, #B22234 69.3%,
        #FFFFFF 69.3%, #FFFFFF 77%,
        #B22234 77%, #B22234 84.7%,
        #FFFFFF 84.7%, #FFFFFF 92.4%,
        #B22234 92.4%, #B22234 100%
    );
    position: relative;
}

.flag-en::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 53.8%;
    background: #3C3B6E;
    border-radius: 2px 0 0 0;
}

.flag-ru {
    background: linear-gradient(180deg, #fff 0%, #fff 33%, #0039a6 33%, #0039a6 66%, #d52b1e 66%);
}

.flag-kz {
    background: #00AFCA;
}

.flag-kz::after {
    content: '';
    position: absolute;
    left: 20%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    background: #FEC50A;
    border-radius: 50%;
}

/* Иконка темы */
.theme-icon {
    color: var(--text-secondary);
}

/* Превью темы */
.theme-item {
    padding: 0.875rem 1rem;
}

.theme-preview {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.theme-color {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--post-bg);
}

.theme-info {
    flex: 1;
    text-align: left;
}

.theme-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.theme-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Модальное окно уведомлений */
.notifications-modal {
    position: absolute;
    top: calc(100% + 8px);
    right: 1.5rem;
    width: 380px;
    max-width: 380px;
    max-height: 480px;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notifications-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Заголовок уведомлений */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--post-border);
    flex-shrink: 0;
}

.notifications-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notifications-actions {
    display: flex;
    gap: 0.5rem;
}

.mark-all-read-btn,
.clear-notifications-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.mark-all-read-btn:hover,
.clear-notifications-btn:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

/* Фильтр уведомлений */
.notification-filter {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--post-border);
    flex-shrink: 0;
}

.filter-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--sidebar-bg);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    background: var(--post-bg);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-color);
    color: white;
}

/* Счетчики в фильтрах */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--sidebar-bg);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
}

.filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Список уведомлений */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    position: relative;
}

/* Элемент уведомления */
.notification-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

/* Непрочитанные уведомления */
.notification-item.unread {
    background: rgba(23, 162, 184, 0.05);
    border-color: transparent;
}

.notification-item.unread:hover {
    background: rgba(23, 162, 184, 0.08);
    border-color: rgba(23, 162, 184, 0.2);
}

/* Прочитанные уведомления */
.notification-item.read {
    opacity: 0.7;
    background: var(--sidebar-bg);
    border-color: var(--post-border);
}

.notification-item.read:hover {
    opacity: 1;
    background: var(--post-bg);
    border-color: var(--input-border);
}

/* Текст в прочитанных уведомлениях */
.notification-item.read .notification-text {
    color: var(--text-secondary);
}

.notification-item.read .notification-title {
    font-weight: 500;
    color: var(--text-secondary);
}

.notification-item.read .notification-message {
    opacity: 0.8;
}

/* Иконки в прочитанных уведомлениях */
.notification-item.read .notification-type-icon {
    opacity: 0.6;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notification-type-icon {
    flex-shrink: 0;
    color: var(--accent-color);
    transition: all 0.2s ease;
}

.notification-item:hover .notification-type-icon {
    transform: scale(1.1);
}

/* Специальные цвета для разных типов иконок */
.notification-item[data-type="group_call"] .notification-type-icon,
.notification-item[data-type="call_ended"] .notification-type-icon {
    color: var(--success-color);
}

.notification-item[data-type="friend_request"] .notification-type-icon,
.notification-item[data-type="friend_accepted"] .notification-type-icon,
.notification-item[data-type="friend_request_accepted"] .notification-type-icon,
.notification-item[data-type="new_follower"] .notification-type-icon {
    color: var(--accent-color);
}

.notification-item[data-type="post_like"] .notification-type-icon,
.notification-item[data-type="post_liked"] .notification-type-icon {
    color: var(--error-color);
}

.notification-item[data-type="post_comment"] .notification-type-icon {
    color: var(--warning-color);
}

.notification-item[data-type="post_shared"] .notification-type-icon {
    color: var(--success-color);
}

.notification-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
}

/* Действия уведомления */
.notification-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding-left: 1rem;
    flex-shrink: 0;
}

/* Точка непрочитанного уведомления */
.notification-dot {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 2px var(--post-bg);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(23, 162, 184, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
    }
}

.notification-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
}

.notification-delete-btn:hover {
    background: var(--sidebar-bg);
    color: var(--error-color);
}

/* Кнопка удаления для прочитанных */
.notification-item.read .notification-delete-btn {
    opacity: 0.3;
}

.notification-item.read:hover .notification-delete-btn {
    opacity: 0.7;
}

.notification-item.read .notification-delete-btn:hover {
    opacity: 1;
    background: var(--sidebar-bg);
    color: var(--error-color);
}

/* Линия разделения перед первым прочитанным уведомлением */
.notification-item.unread + .notification-item.read::before {
    content: '';
    position: absolute;
    top: -0.625rem;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--post-border), transparent);
}

/* Улучшенная анимация появления */
.notification-item {
    animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Задержка анимации для каждого элемента */
.notification-item:nth-child(1) { animation-delay: 0.05s; }
.notification-item:nth-child(2) { animation-delay: 0.1s; }
.notification-item:nth-child(3) { animation-delay: 0.15s; }
.notification-item:nth-child(4) { animation-delay: 0.2s; }
.notification-item:nth-child(5) { animation-delay: 0.25s; }
.notification-item:nth-child(n+6) { animation-delay: 0.3s; }

/* Пустые уведомления */
.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.notifications-empty svg {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.notifications-empty p {
    margin: 0;
    color: var(--text-secondary);
}

/* Загрузка */
.notifications-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}

/* Ошибка */
.notification-error {
    padding: 1rem;
    text-align: center;
    color: var(--error-color);
    font-size: 0.875rem;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--button-primary-bg), var(--accent-color));
    color: var(--button-primary-text);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
    background: var(--post-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
}

.btn-secondary:hover {
    background: var(--sidebar-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: var(--error-color);
    color: var(--button-primary-text);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(220, 53, 69, 0.4);
}

.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Кнопки авторизации в header */
.header-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.altn-header-login-icon-btn,
.altn-header-register-icon-btn,
.altn-mobile-login-auth-btn,
.altn-mobile-register-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.altn-header-login-icon-btn::before,
.altn-header-register-icon-btn::before,
.altn-mobile-login-auth-btn::before,
.altn-mobile-register-auth-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.altn-header-login-icon-btn:active::before,
.altn-header-register-icon-btn:active::before,
.altn-mobile-login-auth-btn:active::before,
.altn-mobile-register-auth-btn:active::before {
    width: 300px;
    height: 300px;
}

.altn-header-login-icon-btn,
.altn-mobile-login-auth-btn {
    background: var(--post-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
}

.altn-header-login-icon-btn:hover,
.altn-mobile-login-auth-btn:hover {
    background: var(--sidebar-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.altn-header-register-icon-btn,
.altn-mobile-register-auth-btn {
    background: linear-gradient(135deg, var(--button-primary-bg), var(--accent-color));
    color: var(--button-primary-text);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
}

.altn-header-register-icon-btn:hover,
.altn-mobile-register-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 123, 255, 0.4);
}

.altn-header-login-icon-btn,
.altn-header-register-icon-btn {
    padding: 0.625rem;
    min-width: 42px;
    height: 42px;
    gap: 0;
}

.altn-mobile-login-auth-btn,
.altn-mobile-register-auth-btn {
    width: 100%;
    display: flex;
    gap: 0.5rem;
}

.altn-header-login-icon-btn svg,
.altn-header-register-icon-btn svg,
.altn-mobile-login-auth-btn svg,
.altn-mobile-register-auth-btn svg {
    flex-shrink: 0;
}

.altn-header-login-icon-btn svg,
.altn-header-register-icon-btn svg {
    transition: transform 0.2s ease;
}

.altn-header-login-icon-btn:hover svg,
.altn-header-register-icon-btn:hover svg {
    transform: scale(1.1);
}

/* User menu */
.user-menu {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-toggle:hover {
    background: var(--sidebar-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Кнопка мобильного меню */
.nav-mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.nav-mobile-toggle:hover {
    background: var(--sidebar-bg);
}

.nav-mobile-toggle span {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-mobile-toggle span:nth-child(1) {
    top: 13px;
}

.nav-mobile-toggle span:nth-child(2) {
    top: 20px;
}

.nav-mobile-toggle span:nth-child(3) {
    top: 27px;
}

.nav-mobile-toggle.active span:nth-child(1) {
    top: 20px;
    transform: translateX(-50%) rotate(45deg);
}

.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
    top: 20px;
    transform: translateX(-50%) rotate(-45deg);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--body-bg);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 997;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-inner {
    padding: 2rem 1.5rem;
    min-height: 100%;
    background: var(--body-bg);
}

.mobile-menu-section {
    margin-bottom: 1.3rem;
}

.mobile-menu-section h3 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.45rem;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--post-bg);
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid var(--post-border);
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mobile-menu-item:hover,
.mobile-menu-item.active {
    background: var(--sidebar-bg);
    transform: translateX(8px);
    border-color: var(--accent-color);
}

.mobile-menu-auth {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--post-border);
}

/* Карточка профиля в мобильном меню */
.mobile-menu-section.mobile-user-profile {
    padding: 0;
    margin-bottom: 1rem;
}

.mobile-user-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mobile-user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.mobile-user-avatar.user-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
    font-size: 1.125rem;
}

.mobile-user-info {
    flex: 1;
}

.mobile-user-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.125rem;
}

.mobile-user-username {
    font-size: 0.8125rem;
    opacity: 0.9;
}

.mobile-user-arrow {
    color: white;
    opacity: 0.7;
}

/* Выбор темы в мобильном меню */
.theme-select {
    justify-content: flex-start;
}

/* ========================================
   МОДАЛЬНОЕ ОКНО ВЫБОРА ТЕМЫ (МОБИЛЬНЫЕ)
   ======================================== */

.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.theme-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.theme-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.theme-modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 70vh;
    max-height: 70dvh;
    background: var(--post-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-modal.active .theme-modal-content {
    transform: scale(1);
}

.theme-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--post-border);
    flex-shrink: 0;
    background: var(--post-bg);
}

.theme-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.theme-modal-close:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

.theme-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background: var(--post-bg);
}

.theme-modal-body::-webkit-scrollbar {
    width: 6px;
}

.theme-modal-body::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.theme-modal-body::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 3px;
}

.theme-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.theme-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.theme-modal-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--post-bg);
    border: 2px solid var(--post-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.theme-modal-item:hover {
    background: var(--sidebar-bg);
    border-color: var(--input-border);
    transform: translateX(4px);
}

.theme-modal-item.active {
    background: var(--sidebar-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.theme-modal-item .theme-preview {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

.theme-modal-item .theme-color {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--post-bg);
}

.theme-modal-item .theme-info {
    flex: 1;
    min-width: 0;
}

.theme-modal-item .theme-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.theme-modal-item .theme-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0.9;
    line-height: 1.3;
}

.theme-modal-item.active .theme-name {
    color: var(--accent-color);
}

/* Основной контент */
.main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
    flex: 1;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    margin-top: auto;
    padding: 3rem 0 1.5rem;
}

.footer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
}

/* Контейнер для партнеров и юр. документов */
.footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4rem;
    width: 100%;
}

.footer-partners {
    flex: 1;
    text-align: center;
}

.partners-title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: var(--footer-text);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.partners-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.partner-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.9;
    border-radius: 8px;
    padding: 4px;
}

.partner-link:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.partner-link:focus {
    outline: 2px solid var(--footer-text);
    outline-offset: 4px;
    opacity: 1;
}

.partner-logo {
    height: 40px;
    width: auto;
}

/* ========== FOOTER ЮРИДИЧЕСКИЕ ДОКУМЕНТЫ ========== */

.footer-legal {
    flex: 1;
    text-align: center;
}

.legal-title {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: var(--footer-text);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.legal-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.legal-link {
    color: var(--footer-text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    padding: 0.25rem 0;
}

.legal-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--footer-text);
    transition: width 0.2s ease;
}

.legal-link:hover {
    color: var(--footer-text);
}

.legal-link:hover::after {
    width: 100%;
}

.footer-copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--footer-border);
    width: 100%;
}

.footer-copyright p {
    margin: 0;
    color: var(--footer-text);
    font-size: 0.9375rem;
    font-weight: 500;
    opacity: 0.95;
}

/* ========== FOOTER APP STORE BUTTONS ========== */

.footer-app-stores {
    width: 100%;
    padding: 1.5rem 0 1rem;
    border-top: 1px solid var(--footer-border);
    text-align: center;
}

.app-stores-title {
    margin: 0 0 1.25rem 0;
    font-size: 1rem;
    color: var(--footer-text-secondary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.app-store-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.app-store-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.app-store-btn:active {
    transform: translateY(0);
}

/* Google Play специфичные стили */
.app-store-btn.google-play {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(234, 67, 53, 0.1));
}

.app-store-btn.google-play:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(234, 67, 53, 0.15));
}

/* App Store специфичные стили */
.app-store-btn.apple-store {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(50, 50, 50, 0.2));
}

.app-store-btn.apple-store:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(50, 50, 50, 0.3));
}

.app-store-btn.apple-store .store-icon {
    color: var(--footer-text);
}

.store-icon {
    flex-shrink: 0;
}

.store-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.store-label {
    font-size: 0.75rem;
    color: var(--footer-text-secondary);
    line-height: 1;
    letter-spacing: 0.02em;
}

.store-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--footer-text);
    line-height: 1;
}

/* Утилитарные классы */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.gap-5 { gap: 2rem; }

/* Спиннер */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s linear infinite;
}

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

/* Тултипы */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

/* Стилизация скроллбара */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

/* Выделение текста */
::selection {
    background: var(--accent-color);
    color: white;
}

::-moz-selection {
    background: var(--accent-color);
    color: white;
}

/* Фокус */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeIn 0.3s ease;
}

/* Уведомления всплывающие */
.notification-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    position: relative;
    max-width: 400px;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    transform: translateX(calc(100% + 20px));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    pointer-events: auto;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    min-height: 56px;
}

.notification-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-text {
    flex: 1;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.notification-success .notification-icon {
    color: var(--success-color);
}

.notification-error .notification-icon {
    color: var(--error-color);
}

.notification-warning .notification-icon {
    color: var(--warning-color);
}

.notification-info .notification-icon {
    color: var(--accent-color);
}

.notification-close {
    flex-shrink: 0;
    align-self: flex-start;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-top: -2px;
}

.notification-close:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

.notifications-view-all-overlay {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, var(--post-bg) 70%, transparent);
    border-top: 1px solid var(--post-border);
    z-index: 10;
    margin-top: -1px;
}

.notifications-view-all-overlay .view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.notifications-view-all-overlay .view-all-link:hover {
    background: var(--button-primary-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.notifications-view-all-overlay .view-all-link svg {
    width: 16px;
    height: 16px;
}

/* Кнопка "Прочитать" для уведомлений */
.notification-mark-read-btn,
.npi-mark-read-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--success-color);
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-item:hover .notification-mark-read-btn,
.notification-page-item:hover .npi-mark-read-btn {
    opacity: 1;
}

.notification-mark-read-btn:hover,
.npi-mark-read-btn:hover {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    transform: scale(1.1);
}

.notification-mark-read-btn svg,
.npi-mark-read-btn svg {
    width: 16px;
    height: 16px;
}

/* Для прочитанных уведомлений - кнопка не показывается */
.notification-item.read .notification-mark-read-btn,
.notification-page-item.read .npi-mark-read-btn {
    display: none;
}

/* SPA Navigation Loader */
#spaNavigationLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--body-bg);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

#spaNavigationLoader.visible {
    opacity: 1;
    pointer-events: all;
}

.spa-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.spa-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
}

.spa-loader-content .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--post-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spa-loader-content span {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Плавный переход цветов при смене темы */
:root,
body,
.site-header,
.nav-action-link,
.dropdown-menu,
.unic-dropdown-menu,
.btn,
.post-bg,
.sidebar-bg {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.mobile-menu-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Блокировка скролла body для модального окна темы */
body.theme-modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

/* Unified lock for all modal-like overlays */
html.altn-scroll-lock,
body.altn-scroll-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}

/* ============================================
   АДАПТИВНОСТЬ ДЛЯ ВСЕХ УСТРОЙСТВ
   ============================================ */

/* Большие экраны */
@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }
    
    .site-container {
        max-width: 1800px;
    }
}

@media (min-width: 1401px) {
    .nav-action-label {
        display: inline;
    }
    
    .nav-actions-group {
        gap: 0.75rem;
    }

    .nav-dropdown.unic-dropdown .nav-action-label {
        display: inline;
    }

    .unic-dropdown-text {
        display: inline;
    }
}

/* Планшеты и средние экраны */
@media (max-width: 1400px) {
    .site-container {
        max-width: 1280px;
        padding: 0 1.5rem;
    }
    
    .header-wrapper {
        gap: 1.5rem;
    }

    .nav-action-label {
        display: none;
    }
    
    .nav-action-link {
        padding: 0.625rem;
        min-width: 42px;
    }
    
    .nav-actions-group {
        gap: 0.375rem;
    }
    
    .header-wrapper {
        gap: 2rem;
    }

    .nav-dropdown.unic-dropdown .nav-action-label {
        display: none;
    }
    
    .nav-dropdown.unic-dropdown .unic-dropdown-toggle {
        padding: 0.625rem;
        min-width: 42px;
    }

    .nav-settings-group .unic-dropdown-toggle {
        padding: 0.625rem;
        min-width: 42px;
    }
}

@media (max-width: 1024px) {
    html {
        font-size: 15px;
    }
    
    .nav-actions-group {
        gap: 0.375rem;
    }
    
    .header-wrapper {
        gap: 1rem;
    }
    
    .header-navigation {
        gap: 1rem;
    }
    
    .footer-top {
        gap: 3rem;
    }
    
    .partners-logos {
        gap: 2rem;
    }
}

@media (max-width: 831px) {
    .user-toggle span {
        display: none;
    }
    
    .user-toggle {
        padding: 0.5rem;
        min-width: 48px;
        justify-content: center;
    }
}

@media (max-width: 771px) {
    .nav-dropdown.unic-dropdown .unic-dropdown-arrow {
        display: none;
    }

    .nav-settings-group .unic-dropdown-arrow {
        display: none;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header-navigation {
        display: none;
    }
    
    .nav-mobile-toggle {
        display: flex;
    }
    
    .header-wrapper {
        height: 64px;
        gap: 0.75rem;
    }
    
    .mobile-menu {
        top: 64px;
        height: calc(100vh - 64px);
        height: calc(100dvh - 64px);
    }
    
    .brand-name {
        font-size: 1.5rem;
    }
    
    .site-container,
    .container {
        padding: 0 1rem;
    }
    
    /* ИСПРАВЛЕНИЕ: уведомления ВСЕГДА справа */
    .notifications-modal {
        width: 360px;
        max-width: calc(100vw - 2rem);
        right: 1rem;
        left: auto;
    }
    
    .main-content {
        min-height: calc(100vh - 64px);
        min-height: calc(100dvh - 64px);
        padding: 1.5rem 0;
    }
    
    .footer-top {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }
    
    .footer-partners,
    .footer-legal {
        width: 100%;
    }
    
    .partners-logos {
        gap: 2rem;
    }
    
    .partner-logo {
        height: 32px;
    }
    
    .legal-links {
        gap: 0.5rem;
    }
    
    .legal-link {
        font-size: 0.875rem;
    }
    
    .footer-app-stores {
        padding: 1rem 0 0.75rem;
    }
    
    .app-stores-title {
        font-size: 0.9375rem;
        margin-bottom: 0.875rem;
    }
    
    .app-store-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }
    
    .app-store-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    /* Модальное окно темы на планшетах */
    .theme-modal {
        padding: 0.75rem;
    }
    
    .theme-modal-content {
        max-height: 65vh;
        max-height: 65dvh;
    }
    
    /* Уведомления всплывающие (toast) */
    .notification-container {
        top: 70px;
        right: 10px;
        left: auto;
    }
    
    .notification {
        max-width: calc(100vw - 20px);
    }
    
    .notification-content {
        padding: 12px;
        min-height: 48px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .site-container,
    .container {
        padding: 0 0.75rem;
    }
    
    .header-wrapper {
        height: 56px;
        padding: 0;
    }
    
    .mobile-menu {
        top: 56px;
        height: calc(100vh - 56px);
        height: calc(100dvh - 56px);
    }
    
    .brand-name {
        font-size: 1.25rem;
    }
    
    .header-brand {
        gap: 0.5rem;
        min-width: auto;
    }
    
    .nav-mobile-toggle {
        width: 40px;
        height: 40px;
    }
    
    /* ИСПРАВЛЕНИЕ: уведомления ВСЕГДА справа */
    .notifications-modal {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        right: 1rem;
        left: auto;
        max-height: calc(100vh - 80px);
        max-height: calc(100dvh - 80px);
    }
    
    .main-content {
        min-height: calc(100vh - 56px);
        min-height: calc(100dvh - 56px);
        padding: 1rem 0;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-wrapper {
        gap: 2rem;
    }
    
    .footer-top {
        gap: 2rem;
    }
    
    .partners-title,
    .legal-title {
        font-size: 1rem;
    }
    
    .partners-logos {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-app-stores {
        padding: 0.75rem 0 0.5rem;
    }
    
    .app-store-btn {
        padding: 0.625rem 1.25rem;
    }
    
    .store-label {
        font-size: 0.7rem;
    }
    
    .store-name {
        font-size: 1rem;
    }
    
    /* Модальное окно темы на маленьких телефонах */
    .theme-modal {
        padding: 0.5rem;
    }
    
    .theme-modal-content {
        max-width: 100%;
        max-height: 70vh;
        max-height: 70dvh;
        border-radius: 12px;
    }
    
    .theme-modal-header {
        padding: 1rem 1.25rem;
    }
    
    .theme-modal-title {
        font-size: 1.125rem;
    }
    
    .theme-modal-body {
        padding: 0.75rem;
    }
    
    .theme-modal-item {
        padding: 0.875rem;
    }
    
    .theme-modal-list {
        gap: 0.5rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    
    .brand-name {
        font-size: 1.125rem;
    }
    
    .mobile-menu-inner {
        padding: 1.5rem 1rem;
    }
    
    .theme-modal-content {
        max-height: 80vh;
        max-height: 80dvh;
    }
}

/* Landscape ориентация на телефонах */
@media (max-width: 896px) and (max-height: 414px) and (orientation: landscape) {
    .header-wrapper {
        height: 48px;
    }
    
    .mobile-menu {
        top: 48px;
        height: calc(100vh - 48px);
        height: calc(100dvh - 48px);
    }
    
    .main-content {
        min-height: calc(100vh - 48px);
        min-height: calc(100dvh - 48px);
        padding: 1rem 0;
    }
    
    .theme-modal-content {
        max-height: 75vh;
        max-height: 75dvh;
    }
    
    .theme-modal-header {
        padding: 0.875rem 1.25rem;
    }
    
    .theme-modal-body {
        padding: 0.75rem;
    }
    
    .theme-modal-item {
        padding: 0.75rem;
    }
    
    .mobile-menu-inner {
        padding: 1rem;
    }
}

/* Адаптация для iOS Safari (безопасная зона) */
@supports (padding: max(0px)) {
    .header-wrapper,
    .mobile-menu-inner,
    .footer-wrapper {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .mobile-menu {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .theme-modal-content {
        max-height: 80vh;
        max-height: 80dvh;
    }
    
    .theme-modal-header {
        padding: 0.875rem 1.25rem;
    }
    
    .theme-modal-body {
        padding: 0.75rem;
    }
    
    .theme-modal-item {
        padding: 0.75rem;
    }
}

/* Адаптация touch устройств */
@media (hover: none) and (pointer: coarse) {
    .nav-action-link:hover,
    .dropdown-toggle:hover,
    .unic-dropdown-toggle:hover,
    .mobile-menu-item:hover,
    .theme-modal-item:hover {
        transform: none;
    }
    
    .nav-action-link:active,
    .mobile-menu-item:active,
    .theme-modal-item:active {
        transform: scale(0.98);
    }
}

/* Режим высокой контрастности */
@media (prefers-contrast: high) {
    :root {
        --post-border: #000000;
        --input-border: #000000;
    }
    
    .nav-action-link,
    .dropdown-toggle,
    .unic-dropdown-toggle,
    .mobile-menu-item {
        border-width: 2px;
    }
}

/* Уменьшение движения для пользователей с motion sensitivity */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .notification-item {
        animation: none;
    }
}

/* Печать */
@media print {
    .site-header,
    .footer,
    .mobile-menu,
    .btn,
    .dropdown,
    .unic-dropdown,
    .theme-modal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .main-content {
        padding: 0;
    }
}

/* Счетчик непрочитанных чатов */
.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--error-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    animation: badgePulse 2s infinite;
}

.chat-badge.mobile {
    position: static;
    margin-left: auto;
}

/* Для кнопки чатов нужна позиция relative */
.chat-link {
    position: relative;
}

/* Анимация пульсации для chat badge */
@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.5);
    }
}

/* Кнопки-иконки для авторизации */
.btn-icon {
    padding: 0.625rem;
    min-width: 42px;
    height: 42px;
    border-radius: 12px;
}

.btn-icon svg {
    flex-shrink: 0;
}

/* Убираем текст, оставляем только иконку */
.header-auth .btn-icon {
    gap: 0;
}

/* Hover эффекты для иконок */
.btn-icon:hover svg {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.btn-icon svg {
    transition: transform 0.2s ease;
}
