/* =====================================================
   HIDEN.LIVE - Main Stylesheet
   ===================================================== */

/* ===== CSS Variables - Dark Theme (Default) ===== */
:root {
    --bg: #121212;
    --bg-elevated: #1a1a1a;
    --panel: #1e1e1e;
    --sidebar: #161616;
    --card: #252525;
    --text: #f0f0f0;
    --text-dim: #a0a0a0;
    --muted: #808080;
    --accent: #e0e0e0;
    --accent-2: #ffb74d;
    --accent-glow: rgba(255, 255, 255, 0.08);
    --border: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.12);
    --shadow-color: rgba(0,0,0,0.5);
    --input-bg: var(--card);
    --modal-bg: var(--panel);
}

/* ===== CSS Variables - Light Theme ===== */
[data-theme="light"] {
    --bg: #f5f7fa;
    --bg-elevated: #ffffff;
    --panel: #ffffff;
    --sidebar: #f0f2f5;
    --card: #ffffff;
    --text: #1a1d23;
    --text-dim: #4a5568;
    --muted: #718096;
    --accent: #5a7daa;
    --accent-2: #e67e22;
    --accent-glow: rgba(90, 125, 170, 0.15);
    --border: rgba(0,0,0,0.08);
    --border-light: rgba(0,0,0,0.12);
    --shadow-color: rgba(0,0,0,0.08);
    --input-bg: #f0f2f5;
    --modal-bg: #ffffff;
}

/* Light theme specific overrides */
[data-theme="light"] body {
    background: var(--bg);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #f0f2f5 0%, #e8eaef 100%);
    border-right-color: var(--border);
}

[data-theme="light"] .topbar {
    background: rgba(255,255,255,0.95);
    border-bottom-color: var(--border);
}

[data-theme="light"] .search-input {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .search-input::placeholder {
    color: var(--muted);
}

[data-theme="light"] .card {
    background: var(--card);
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 1px solid var(--border);
}

[data-theme="light"] .card:hover {
    box-shadow: 0 4px 16px var(--shadow-color);
}

[data-theme="light"] .sidebar a {
    color: var(--text-dim);
}

[data-theme="light"] .sidebar a:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text);
}

[data-theme="light"] .sidebar a.active {
    background: rgba(90,125,170,0.1);
    color: var(--text);
}

[data-theme="light"] .sidebar .cat-count {
    background: rgba(0,0,0,0.05);
    color: var(--muted);
}

[data-theme="light"] .modal-content {
    background: var(--modal-bg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

[data-theme="light"] .form-input {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .auth-btn {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .auth-btn:hover {
    background: var(--input-bg);
    border-color: var(--border-light);
}

[data-theme="light"] footer {
    background: var(--sidebar);
    border-top: 1px solid var(--border);
}

[data-theme="light"] .notifications-dropdown {
    background: var(--card);
    box-shadow: 0 8px 32px var(--shadow-color);
}

[data-theme="light"] .mobile-cat-toggle,
[data-theme="light"] .mobile-search-toggle,
[data-theme="light"] .mobile-messages-toggle,
[data-theme="light"] .mobile-notifications-toggle {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="light"] .sidebar-brand a {
    background: linear-gradient(135deg, #5a7daa, #3d5a80);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .sidebar-brand a:hover,
[data-theme="light"] .sidebar-brand a:focus,
[data-theme="light"] .sidebar-brand a:active {
    background: linear-gradient(135deg, #3d5a80, #2c4a6e) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    filter: none;
}

[data-theme="light"] .user-avatar-small-default,
[data-theme="light"] .sidebar-user-avatar-default {
    background: linear-gradient(135deg, #5a7daa, #3d5a80);
}

[data-theme="light"] .chat-message {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="light"] .video-actions button,
[data-theme="light"] .video-actions a {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text-dim);
}

[data-theme="light"] .video-actions button:hover,
[data-theme="light"] .video-actions a:hover {
    background: var(--card);
    border-color: var(--border-light);
}

/* ===== Light Theme - Video List Page ===== */
[data-theme="light"] .page-title,
[data-theme="light"] .videos-section-heading,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 {
    color: var(--text);
}

[data-theme="light"] .home-subtitle,
[data-theme="light"] .home-subtitle-text,
[data-theme="light"] .category-description,
[data-theme="light"] .site-description {
    color: var(--text-dim);
    background: rgba(0,0,0,0.02);
    border-color: var(--border);
}

[data-theme="light"] .card-title {
    color: var(--text) !important;
}

[data-theme="light"] .card-title:hover {
    color: var(--accent) !important;
}

[data-theme="light"] .card-body {
    background: transparent;
}

[data-theme="light"] .card-tags {
    border-top-color: var(--border);
}

[data-theme="light"] .card-tag {
    background: rgba(0,0,0,0.04);
    border-color: var(--border);
    color: var(--text-dim);
}

[data-theme="light"] .card-tag:hover {
    background: rgba(90,125,170,0.1);
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="light"] .cat-badge {
    background: linear-gradient(135deg, rgba(90,125,170,0.15), rgba(90,125,170,0.1));
    border-color: rgba(90,125,170,0.3);
    color: #4a6fa5;
}

[data-theme="light"] .cat-badge:hover {
    background: linear-gradient(135deg, rgba(90,125,170,0.25), rgba(90,125,170,0.15));
    border-color: rgba(90,125,170,0.5);
}

[data-theme="light"] .date-label {
    background: rgba(0,0,0,0.04);
    border-color: var(--border);
    color: var(--muted);
}

[data-theme="light"] .stat-item {
    color: var(--muted);
}

[data-theme="light"] .search-result-info {
    background: linear-gradient(135deg, rgba(90,125,170,0.08), rgba(90,125,170,0.04));
    border-color: rgba(90,125,170,0.15);
    color: var(--text-dim);
}

[data-theme="light"] .search-result-info strong {
    color: var(--accent);
}

/* Light theme - Pagination */
[data-theme="light"] .pagination a,
[data-theme="light"] .pagination span {
    background: var(--card);
    border-color: var(--border);
    color: var(--text-dim);
}

[data-theme="light"] .pagination a:hover {
    background: var(--input-bg);
    border-color: var(--border-light);
    color: var(--text);
}

[data-theme="light"] .pagination .current {
    background: linear-gradient(135deg, #5a7daa, #3d5a80);
    color: #fff;
    border-color: transparent;
}

/* Light theme - Container backgrounds */
[data-theme="light"] .container {
    background: transparent;
}

[data-theme="light"] .card-grid {
    background: transparent;
}

/* Light theme - Links general */
[data-theme="light"] a {
    color: var(--text);
}

[data-theme="light"] a:hover {
    color: var(--accent);
}

/* ===== Light Theme - Video Cards ===== */
[data-theme="light"] .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="light"] .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: var(--border-light);
}

[data-theme="light"] .thumb-wrapper {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

[data-theme="light"] .thumb {
    background: linear-gradient(135deg, #e8eaef, #d0d4dc);
}

/* ===== Light Theme - Category Index Page ===== */
[data-theme="light"] .category-index h1 {
    background: linear-gradient(135deg, #1a1d23, #4a5568) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .category-card {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="light"] .category-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--border-light);
}

[data-theme="light"] .category-card__title {
    color: var(--text);
}

[data-theme="light"] .category-card__count {
    color: var(--muted);
}

[data-theme="light"] .category-card__full-desc {
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.03);
    border-top-color: var(--border);
}

[data-theme="light"] .category-card__no-preview {
    background: linear-gradient(135deg, #e8eaef, #d0d4dc);
    color: var(--muted);
}

[data-theme="light"] .category-card__info {
    background: transparent;
}

/* ===== Light Theme - Category SEO Section ===== */
[data-theme="light"] .category-seo {
    background: rgba(0,0,0,0.02);
    border-color: var(--border);
}

[data-theme="light"] .category-seo__title {
    color: var(--text);
}

[data-theme="light"] .category-seo__text,
[data-theme="light"] .category-seo__text p {
    color: var(--text-dim);
}

[data-theme="light"] .category-seo__list li {
    color: var(--text-dim);
}

/* ===== Light Theme - Home Page Elements ===== */
[data-theme="light"] .home-cards .card {
    background: var(--card);
    border: 1px solid var(--border);
}

[data-theme="light"] .videos-section-heading {
    color: var(--text) !important;
}

/* ===== Light Theme - Badges ===== */
[data-theme="light"] .duration-badge,
[data-theme="light"] .views-badge {
    background: rgba(0,0,0,0.7);
    color: #fff;
}

[data-theme="light"] .rating-badge {
    background: linear-gradient(135deg, rgba(90,125,170,0.25), rgba(90,125,170,0.2));
    border-color: rgba(90,125,170,0.35);
}

[data-theme="light"] .rating-badge.rating-tier-1 {
    background: rgba(100,116,139,0.15);
    color: #475569;
    border-color: rgba(100,116,139,0.4);
}

[data-theme="light"] .rating-badge.rating-tier-2 {
    background: rgba(34,197,94,0.15);
    color: #15803d;
    border-color: rgba(34,197,94,0.4);
}

[data-theme="light"] .rating-badge.rating-tier-3 {
    background: rgba(59,130,246,0.15);
    color: #1d4ed8;
    border-color: rgba(59,130,246,0.4);
}

[data-theme="light"] .rating-badge.rating-tier-4 {
    background: rgba(245,158,11,0.15);
    color: #b45309;
    border-color: rgba(245,158,11,0.4);
}

[data-theme="light"] .rating-badge.rating-tier-5 {
    background: rgba(245,158,11,0.2);
    color: #92400e;
    border-color: rgba(245,158,11,0.5);
    box-shadow: 0 0 8px rgba(245,158,11,0.3);
}

[data-theme="light"] .profile-admin {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.4);
    color: #b45309;
}

/* ===== Light Theme - Infinite Loader ===== */
[data-theme="light"] .loader-spinner {
    border-color: rgba(90,125,170,0.15);
    border-top-color: #5a7daa;
}

[data-theme="light"] .loader-text {
    color: var(--muted);
}

[data-theme="light"] .end-icon {
    background: linear-gradient(135deg, rgba(90,125,170,0.1), rgba(90,125,170,0.08));
    border-color: rgba(90,125,170,0.2);
    color: #5a7daa;
}

[data-theme="light"] .end-text {
    color: var(--text);
}

[data-theme="light"] .end-subtext {
    color: var(--muted);
}

/* ===== Page Main Title (Dark Theme Default) ===== */
.page-main-title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #b8c1d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Light Theme - Main Title */
[data-theme="light"] .page-main-title {
    background: linear-gradient(135deg, #1a1d23, #4a5568) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ===== Light Theme - Category Card Count Badge ===== */
[data-theme="light"] .category-card__count {
    background: linear-gradient(135deg, #6b7280, #4b5563) !important;
    color: #fff !important;
}

/* ===== Light Theme - Profile Page ===== */
[data-theme="light"] .profile-card {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="light"] .profile-name-text {
    color: var(--text);
}

[data-theme="light"] .profile-sub {
    color: var(--muted);
}

[data-theme="light"] .profile-tags span {
    background: var(--input-bg);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

[data-theme="light"] .profile-bio {
    color: var(--text-dim);
}

[data-theme="light"] .profile-nav-btn {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

[data-theme="light"] .profile-nav-btn:hover {
    border-color: var(--accent);
    background: rgba(90, 125, 170, 0.08);
}

[data-theme="light"] .profile-nav-btn.active {
    border-color: var(--accent);
    background: rgba(90, 125, 170, 0.12);
}

[data-theme="light"] .stat-item {
    background: var(--input-bg);
    border-color: var(--border);
}

[data-theme="light"] .stat-value {
    color: var(--text);
}

[data-theme="light"] .stat-label {
    color: var(--muted);
}

[data-theme="light"] .section-header h3 {
    color: var(--text);
}

[data-theme="light"] .wall-composer textarea,
[data-theme="light"] .wall-mention-input {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .wall-composer textarea:focus,
[data-theme="light"] .wall-mention-input:focus {
    border-color: var(--accent);
    background: var(--card);
}

[data-theme="light"] .wall-post {
    background: var(--input-bg);
    border-color: var(--border);
}

[data-theme="light"] .wall-post-author {
    color: var(--text);
}

[data-theme="light"] .wall-post-text {
    color: var(--text-dim);
}

[data-theme="light"] .wall-post-time {
    color: var(--muted);
}

/* Light theme - Buttons (grey instead of blue) */
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
    color: #fff !important;
}

[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.4);
    color: #fff !important;
}

[data-theme="light"] .btn-secondary {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .btn-secondary:hover {
    background: var(--card);
    border-color: var(--border-light);
}

/* Light theme - User Profile Popup Buttons */
[data-theme="light"] .user-profile-popup-btn.primary {
    background: linear-gradient(135deg, #5a7daa, #3d5a80);
    color: #fff;
}

[data-theme="light"] .user-profile-popup-btn.primary:hover {
    background: linear-gradient(135deg, #6a8dba, #4d6a90);
}

[data-theme="light"] .user-profile-popup-btn.secondary {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
}

[data-theme="light"] .user-profile-popup-btn.secondary:hover {
    background: #eee;
}

[data-theme="light"] .user-profile-popup-btn.friend {
    background: linear-gradient(135deg, #5a9a5a, #4a8a4a);
    color: #fff;
}

[data-theme="light"] .user-profile-popup-btn.friend:hover {
    background: linear-gradient(135deg, #6aaa6a, #5a9a5a);
}

/* Light theme - Auth overlay buttons */
[data-theme="light"] .auth-overlay-btn {
    background: #f5f5f5;
    border-color: #ddd;
    color: #333;
}

[data-theme="light"] .auth-overlay-btn:hover {
    background: #eee;
}

[data-theme="light"] .auth-overlay-btn.primary {
    background: linear-gradient(135deg, #5a7daa, #3d5a80);
    color: #fff;
}

[data-theme="light"] .auth-overlay-btn.primary:hover {
    background: linear-gradient(135deg, #6a8dba, #4d6a90);
}

/* Light theme - Friends tabs */
[data-theme="light"] .friends-tab {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text-dim);
}

[data-theme="light"] .friends-tab:hover {
    background: var(--card);
    border-color: var(--border-light);
}

[data-theme="light"] .friends-tab.active {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    border-color: transparent;
}

/* Light theme - Friend card */
[data-theme="light"] .friend-card {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="light"] .friend-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

[data-theme="light"] .friend-name {
    color: var(--text);
}

/* Light theme - Album card */
[data-theme="light"] .album-card {
    background: var(--card);
    border-color: var(--border);
}

[data-theme="light"] .album-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

[data-theme="light"] .album-title {
    color: var(--text);
}

[data-theme="light"] .album-count {
    color: var(--muted);
}

/* Light theme - Settings form */
[data-theme="light"] .form-group label {
    color: var(--text);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group select:focus,
[data-theme="light"] .form-group textarea:focus {
    border-color: var(--accent);
    background: var(--card);
}

/* Light theme - Empty state */
[data-theme="light"] .empty-state {
    color: var(--muted);
}

/* Light theme - Photo help */
[data-theme="light"] .photo-help {
    color: var(--muted);
}

/* Light theme - Album form */
[data-theme="light"] .album-form input {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="light"] .album-form input:focus {
    border-color: var(--accent);
    background: var(--card);
}

/* Light theme - Nav count badges */
[data-theme="light"] .nav-count,
[data-theme="light"] .tab-count {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.25);
    color: #4b5563;
}

/* Light theme - Favorite videos section */
[data-theme="light"] .fav-section-header h2 {
    color: var(--text);
}

/* Light theme - Photo Overlay */
[data-theme="light"] .photo-overlay-backdrop {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .photo-overlay-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .photo-overlay-close {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
}

[data-theme="light"] .photo-overlay-close:hover {
    background: var(--input-bg);
    color: var(--text);
}

[data-theme="light"] .photo-overlay-side {
    border-left-color: var(--border);
    background: var(--card);
}

[data-theme="light"] .photo-overlay-owner {
    color: var(--text);
}

[data-theme="light"] .photo-like-btn {
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--muted);
}

[data-theme="light"] .photo-like-btn:hover {
    border-color: var(--border-light);
    background: var(--card);
    color: var(--text);
}

[data-theme="light"] .photo-like-btn.is-on {
    border-color: rgba(180, 130, 40, 0.45);
    background: rgba(255, 183, 77, 0.15);
    color: #b48228;
}

[data-theme="light"] .photo-c-item {
    border-bottom-color: var(--border);
}

[data-theme="light"] .photo-c-avatar {
    border-color: var(--border);
}

[data-theme="light"] .photo-c-avatar.fallback {
    background: var(--input-bg);
    color: var(--text);
}

[data-theme="light"] .photo-c-meta {
    color: var(--muted);
}

[data-theme="light"] .photo-c-delete:hover {
    color: #dc2626;
}

[data-theme="light"] .photo-c-name {
    color: var(--text);
}

[data-theme="light"] .photo-c-text {
    color: var(--text);
}

[data-theme="light"] .photo-overlay-form textarea {
    border-color: var(--border);
    background: var(--input-bg);
    color: var(--text);
}

[data-theme="light"] .photo-overlay-form textarea:focus {
    border-color: var(--accent);
    background: var(--card);
}

[data-theme="light"] .photo-thumb {
    border-color: var(--border);
}

/* ===== Reset & Base ===== */
* { box-sizing: border-box; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
input, textarea, select, .search-input { user-select: text; }

body.page-video-list,
body.page-video-detail {
    overflow-x: hidden;
}

/* Показывать только на мобильных */
.mobile-only,
.sidebar .mobile-only,
.sidebar a.mobile-only {
    display: none !important;
}

@media (max-width: 900px) {
    .mobile-only,
    .sidebar .mobile-only,
    .sidebar a.mobile-only {
        display: flex !important;
    }
}

/* ===== Layout ===== */
.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    border-right: 1px solid var(--border);
    padding: 28px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    will-change: transform;
}

/* Мобильные кнопки авторизации в сайдбаре */
.sidebar-auth-buttons {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-chat-btn {
    display: none;
}

.sidebar-user-profile {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.sidebar-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.15);
}

.sidebar-user-avatar-default {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #404040, #303030);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.15);
}

.sidebar-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 2px;
}

.sidebar-user-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}

.sidebar-logout-link {
    font-size: 11px;
    color: var(--muted);
    opacity: 0.8;
}

.sidebar-logout-link:hover {
    color: #ff6b6b;
    opacity: 1;
}

.sidebar-chat-btn-special {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%) !important;
    border-color: #ff6b6b !important;
    color: #fff !important;
    text-align: center;
    text-decoration: none;
}

.sidebar-chat-btn-special:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e04848 100%) !important;
}

.sidebar-auth-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.sidebar-auth-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

.sidebar-auth-btn.primary {
    background: linear-gradient(135deg, #404040, #303030);
    border-color: transparent;
    color: #fff;
}

.sidebar-auth-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.sidebar-logout-btn {
    color: #ff4757;
}

.sidebar-logout-btn:hover {
    background: rgba(255,71,87,0.1);
    border-color: rgba(255,71,87,0.3);
}

/* Стильный scrollbar для sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.15);
}

.sidebar .sidebar-heading {
    margin: 0 0 16px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    padding: 0 10px;
}

.sidebar .sidebar-heading.sidebar-heading-linklike {
    margin: 12px 0 4px;
    padding: 8px 10px;
    font-size: 13.5px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-dim);
    font-weight: 500;
}

.sidebar a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--text-dim);
    background: transparent;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}

.sidebar-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar a:hover .sidebar-icon {
    opacity: 1;
}

.sidebar .cat-name {
    flex: 1;
    font-weight: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar .cat-count {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar a.active {
    background: rgba(122,146,176,0.08);
    border-left-color: transparent;
    color: var(--text);
    font-weight: 600;
}

.sidebar a.active .cat-count {
    background: rgba(122,146,176,0.15);
    color: var(--accent);
}

.sidebar a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text);
    padding-left: 12px;
}

.sidebar a:hover .cat-count {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* ===== Content Area ===== */
.content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Mobile Buttons ===== */
.mobile-left-buttons {
    display: none;
    align-items: center;
    gap: 8px;
}

.mobile-cat-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-cat-toggle svg {
    width: 20px;
    height: 20px;
}

.mobile-cat-toggle:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.mobile-cat-toggle:active {
    transform: scale(0.95);
}

.mobile-notifications-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-notifications-toggle svg {
    width: 20px;
    height: 20px;
}

.mobile-notifications-toggle:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.mobile-notifications-toggle:active {
    transform: scale(0.95);
}

.mobile-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ff4757, #ff6348);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

.mobile-messages-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
}

.mobile-messages-toggle:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.mobile-messages-toggle:active {
    transform: scale(0.95);
}

.mobile-messages-toggle svg {
    width: 20px;
    height: 20px;
}

.mobile-unread-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ff4757, #ff6348);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

/* ===== Top Bar ===== */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(18,18,18,0.95);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.02);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    letter-spacing: 0.5px;
}

.logo a {
    text-decoration: none;
    background: linear-gradient(135deg, #b7c7e5, #8ba5cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: filter 0.2s ease;
    color: transparent;
}

.logo a:hover {
    filter: brightness(1.1);
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* Sidebar brand */
.sidebar-brand {
    margin-bottom: 20px;
    padding: 0 2px;
}

.sidebar-brand a {
    display: inline-block;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0.4px;
    text-decoration: none;
    background: linear-gradient(135deg, #e0e0e0, #b0b0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    transition: filter 0.2s ease;
}

/* Стили для логотипа-картинки */
.sidebar-logo-img {
    max-width: 220px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: filter 0.2s ease, transform 0.2s ease;
}

/* Защита на случай сторонних/старых правил (например img{width:100%}) */
.sidebar-brand img {
    max-width: 220px !important;
    max-height: 56px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    display: block;
}

.sidebar-brand a:has(.sidebar-logo-img) {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.sidebar-brand a:hover .sidebar-logo-img,
.sidebar-brand a:focus .sidebar-logo-img {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.sidebar-brand a:hover,
.sidebar-brand a:focus,
.sidebar-brand a:active {
    filter: brightness(1.08);
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    background: linear-gradient(135deg, #e0e0e0, #b0b0b0);
    -webkit-background-clip: text;
    background-clip: text;
    text-decoration: none;
}

.sidebar-brand-tagline {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.35;
}

.sidebar .logo-section {
    margin-bottom: 20px;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
}

.sidebar .logo-section .chat-header-link {
    padding: 8px 12px;
    background: rgba(122,146,176,0.1);
    border: 1px solid rgba(122,146,176,0.2);
    border-radius: 10px;
    display: none;
}

.home-header-link,
.chat-header-link {
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
}

/* Home link: text on desktop, icon on mobile */
.home-header-link .home-header-icon {
    display: none;
    width: 18px;
    height: 18px;
}

.home-header-link .home-header-text {
    display: inline;
}

.home-header-link:hover,
.chat-header-link:hover {
    background: rgba(122,146,176,0.1);
    color: var(--accent);
    border-color: rgba(255,255,255,0.08);
}

.sidebar-chat-btn {
    margin-top: 10px;
    background: rgba(122,146,176,0.1);
    border-color: rgba(122,146,176,0.2);
}

.sidebar-chat-btn:hover {
    background: rgba(122,146,176,0.2);
    border-color: rgba(122,146,176,0.3);
}

.top-links { 
    display: flex; 
    gap: 8px; 
    align-items: center;
    margin-left: auto;
}

.top-links a {
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.top-links a.active,
.top-links a:hover {
    color: var(--accent);
    background: rgba(122,146,176,0.08);
}

/* ===== Auth Overlay ===== */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

#friendRequestOverlay,
#friendInfoOverlay {
    z-index: 12000;
}

.auth-overlay-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    text-align: center;
}

.auth-overlay-box h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--text);
}

.auth-overlay-box p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-overlay-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}

.auth-overlay-btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-overlay-btn:hover {
    background: var(--card);
    border-color: var(--border-light);
}

.auth-overlay-btn.primary {
    background: linear-gradient(135deg, #505050, #404040);
    color: #fff;
    border: none;
}

.auth-overlay-btn.primary:hover {
    background: linear-gradient(135deg, #606060, #505050);
}

.auth-overlay-close {
    margin-top: 8px;
    display: inline-block;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
}

/* ===== Auth Buttons ===== */
.auth-btn {
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn:hover {
    background: var(--bg-elevated);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.auth-btn-primary {
    background: linear-gradient(135deg, #404040, #303030);
    border-color: transparent;
    color: #fff;
}

.auth-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* ===== User Avatar in Header ===== */
.user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.2s;
}

.user-link:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.15);
}

.user-avatar-small-default {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #404040, #303030);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.15);
}

.auth-link {
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.auth-link:hover {
    color: #ff4757;
    background: rgba(255,71,87,0.1);
}

/* ===== Messages Icon ===== */
.messages-link {
    position: relative;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.messages-link:hover {
    background: rgba(122,146,176,0.08);
    color: var(--accent);
}

.messages-link svg {
    width: 20px;
    height: 20px;
}

/* ===== Notifications ===== */
.notifications-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.notifications-link {
    position: relative;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notifications-link:hover {
    background: rgba(122,146,176,0.08);
    color: var(--accent);
}

.notifications-link svg {
    width: 20px;
    height: 20px;
}

.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ff4757, #ff6348);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

.notifications-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 330px;
    max-width: 80vw;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    z-index: 9999;
    overflow: hidden;
    transform: translateZ(0);
}

.notifications-dropdown[hidden] {
    display: none !important;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.notifications-mark-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
}

.notifications-mark-all:hover {
    background: rgba(255,255,255,0.12);
}

.notifications-list {
    max-height: 360px;
    overflow-y: auto;
}

.notifications-list .muted.center {
    padding: 14px;
    display: block;
    text-align: center;
}

.notification-item {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(255,255,255,0.04);
}

.notification-item.is-unread {
    background: rgba(255,255,255,0.08);
}

.notification-avatar {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px;
    max-height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex: 0 0 auto;
    display: block;
}

.notification-avatar.fallback {
    display: grid;
    place-items: center;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.notification-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-title {
    font-size: 13px;
    font-weight: 700;
}

.notification-snippet {
    font-size: 12px;
    color: var(--text);
    line-height: 1.35;
}

.notification-time {
    font-size: 11px;
    color: var(--muted);
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-left: 4px;
    flex: 0 0 auto;
}

/* ===== Admin Icon ===== */
.admin-link {
    position: relative;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-link:hover {
    background: rgba(255,183,77,0.08);
    color: var(--accent-2);
}

.admin-link svg {
    width: 20px;
    height: 20px;
}

.unread-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ff4757, #ff6348);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: none;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.unread-badge.show {
    display: block;
}

/* ===== User Popup ===== */
.user-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.user-popup.active { display: flex; }

.user-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

/* ===== Photo Overlay ===== */
.photo-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
}

.photo-overlay[hidden] {
    display: none !important;
}

.photo-overlay-open {
    overflow: hidden;
}

.photo-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
}

.photo-overlay-card {
    position: relative;
    width: min(1100px, calc(100vw - 24px));
    height: min(740px, calc(100vh - 24px));
    margin: 12px auto;
    background: rgba(14, 16, 20, 0.98);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.55);
}

.photo-overlay-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    z-index: 2;
    font-weight: 900;
}

.photo-overlay-close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.photo-overlay-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    height: 100%;
}

.photo-overlay-media {
    background: #000;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.photo-overlay-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.photo-overlay-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-left: 1px solid rgba(255,255,255,0.10);
    background: rgba(18, 20, 26, 0.96);
}

.photo-overlay-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.photo-overlay-meta-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.photo-overlay-owner {
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.photo-overlay-date {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.photo-overlay-reactions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.photo-like-btn {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 900;
    font-size: 12px;
}

.photo-like-btn:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: var(--text);
}

.photo-like-btn.is-on {
    border-color: rgba(255,183,77,0.45);
    background: rgba(255,183,77,0.12);
    color: #ffd37a;
}

.photo-like-ico {
    font-size: 13px;
    line-height: 1;
    opacity: 0.9;
}

.photo-overlay-comments {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.photo-c-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.photo-c-item:last-child {
    border-bottom: none;
}

.photo-c-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
    flex: 0 0 auto;
    display: block;
}

.photo-c-avatar.fallback {
    display: grid;
    place-items: center;
    font-weight: 900;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 12px;
    text-transform: uppercase;
}

.photo-c-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.photo-c-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.photo-c-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
}

.photo-c-date {
    white-space: nowrap;
    opacity: 0.8;
}

.photo-c-delete {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    padding: 0 4px;
}

.photo-c-delete:hover {
    color: #ff7a7a;
}

.photo-c-name {
    font-weight: 900;
    color: var(--text);
    text-decoration: none;
}

.photo-c-name.is-banned {
    text-decoration: line-through;
    opacity: 0.78;
}

.photo-c-text {
    margin-top: 4px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.photo-overlay-form {
    position: relative;
}

.photo-overlay-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 64px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.25);
    color: var(--text);
}

.photo-overlay-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.photo-overlay-form-actions .btn-secondary {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.photo-overlay-form-actions .btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

@media (max-width: 920px) {
    .photo-overlay-card {
        height: calc(100vh - 24px);
    }
    .photo-overlay-body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    .photo-overlay-side {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.10);
        max-height: 44vh;
    }
}

/* ===== Photo Overlay Extras ===== */
.photo-mention-suggest {
    bottom: 100%;
}

.photo-thumb {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    width: 120px;
    height: 120px;
}

.photo-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
}

.photo-thumb-delete:hover {
    background: rgba(220,80,80,0.85);
    border-color: rgba(220,80,80,0.8);
}

.photo-viewer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-secondary.danger {
    border-color: rgba(255, 120, 120, 0.35);
    color: #ff9a9a;
}

.btn-secondary.danger:hover {
    border-color: rgba(255, 120, 120, 0.6);
    color: #ffd2d2;
}

/* ===== Profile Nav Counts ===== */
.nav-count,
.tab-count {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    margin-left: 6px;
}

.tab-count {
    margin-left: 4px;
}

.nav-count:empty,
.tab-count:empty,
.nav-count[hidden],
.tab-count[hidden] {
    display: none !important;
}

/* ===== Global Wall Info Position ===== */
.wall-card-with-info {
    position: relative;
}

.wall-info-float {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

/* ===== User Profile Popup (Chat Style) ===== */
.user-profile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.user-profile-overlay.active {
    display: flex;
}

.user-profile-popup {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: popupAppear 0.3s ease;
}

@keyframes popupAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.user-profile-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.user-profile-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.user-profile-popup-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-profile-popup-close:hover {
    background: var(--bg-elevated);
}

.user-profile-popup-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.user-profile-popup-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--border);
    object-fit: cover;
}

.user-profile-popup-avatar-default {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #404040, #303030);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    border: 3px solid var(--border);
}

.user-profile-popup-info {
    text-align: center;
    margin-bottom: 20px;
}

.user-profile-popup-username {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.user-profile-popup-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.user-profile-popup-status.online {
    background: rgba(77, 205, 94, 0.15);
    color: var(--success);
}

.user-profile-popup-status.offline {
    background: rgba(122, 146, 176, 0.15);
    color: var(--text-muted);
}

.user-profile-popup-bio {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.user-profile-popup-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.user-profile-popup-stat {
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: 10px;
    border: 1px solid var(--border);
    text-align: center;
}

.user-profile-popup-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.user-profile-popup-stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.user-profile-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-profile-popup-loading {
    text-align: center;
    padding: 24px;
    color: var(--muted);
}

.user-profile-popup-btn {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.user-profile-popup-btn.primary {
    background: linear-gradient(135deg, #505050, #404040);
    color: #fff;
}

.user-profile-popup-btn.primary:hover {
    background: linear-gradient(135deg, #606060, #505050);
    transform: translateY(-1px);
}

.user-profile-popup-btn.secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
}

.user-profile-popup-btn.secondary:hover {
    background: var(--bg-input);
}

.user-profile-popup-btn.friend {
    background: linear-gradient(135deg, #3a4a3a, #2d3a2d);
    color: #8fbc8f;
    border: none;
}

.user-profile-popup-btn.friend:hover {
    background: linear-gradient(135deg, #4a5a4a, #3a4a3a);
}

.photo-upload-btn.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.user-popup-content {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 360px;
    padding: 24px;
    z-index: 10001;
}

.user-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.user-popup-close:hover { background: rgba(255,255,255,0.05); }

.user-popup-loading { text-align: center; padding: 40px; color: var(--muted); }

.user-popup-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: block;
    border: 3px solid rgba(255,255,255,0.3);
}

.user-popup-avatar-default {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #404040, #303030);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 16px;
}

.user-popup-username {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.user-popup-bio {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.user-popup-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.user-popup-stat {
    text-align: center;
}

.user-popup-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.user-popup-stat-label {
    font-size: 12px;
    color: var(--muted);
}

.user-popup-actions {
    display: flex;
    gap: 8px;
}

.user-popup-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.user-popup-btn-primary {
    background: linear-gradient(135deg, #404040, #303030);
    border: none;
    color: #fff;
}

.user-popup-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,255,255,0.4);
}

.user-popup-btn-secondary {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.user-popup-btn-secondary:hover {
    background: var(--bg-elevated);
}

/* ===== Search Form ===== */
.search-form {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-input {
    width: min(640px, 90%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 16px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
    color: var(--muted);
}

/* ===== Container & Grid ===== */
.container { padding: 24px; }
.muted { color: var(--muted); font-size: 0.92rem; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.sidebar-overlay { display: none; }

/* ===== Mobile Search ===== */
.mobile-search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.mobile-search-toggle svg {
    width: 20px;
    height: 20px;
}

.mobile-search-toggle:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.mobile-search-toggle:active {
    transform: scale(0.95);
}

/* Оверлей мобильного поиска */
.mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(2px);
}

.mobile-search-overlay.active {
    display: flex;
}

.mobile-search-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding: 20px;
    padding-top: 60px;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 24px;
    gap: 12px;
}

.mobile-search-input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 16px;
    transition: all 0.2s ease;
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.mobile-search-input::placeholder {
    color: var(--muted);
}

.mobile-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s ease;
    padding: 0;
}

.mobile-search-close:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

.mobile-search-results {
    width: 100%;
    max-width: 600px;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.mobile-search-result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    cursor: pointer;
}

.mobile-search-result-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.mobile-search-result-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e2530, #14181f);
    overflow: hidden;
    flex-shrink: 0;
}

.mobile-search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-search-result-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-search-result-meta {
    font-size: 12px;
    color: var(--muted);
}

.mobile-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 60px;
    color: var(--muted);
    text-align: center;
    gap: 12px;
}

.mobile-search-empty-icon {
    font-size: 48px;
    opacity: 0.5;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Responsive: Tablet & Mobile (max-width: 900px) ===== */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%) translateZ(0);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        box-shadow: 4px 0 24px rgba(0,0,0,0.6);
        padding: 24px 16px;
    }
    
    .sidebar.open { transform: translateX(0) translateZ(0); }
    
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        backdrop-filter: blur(6px);
    }
    
    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: all;
    }
    
    .mobile-left-buttons { display: flex; }
    .mobile-cat-toggle { display: inline-flex; }
    .mobile-messages-toggle { display: inline-flex; }
    .mobile-notifications-toggle { display: inline-flex; }
    .mobile-search-toggle { display: inline-flex; }

    /* Яндекс: избегаем текста < 12px на мобилке */
    .sidebar .sidebar-heading { font-size: 12px; }
    .sidebar .sidebar-heading.sidebar-heading-linklike { font-size: 13.5px; }
    .sidebar .cat-count { font-size: 12px; }
    .mobile-unread-badge,
    .unread-badge { font-size: 12px; }
    .topbar { justify-content: space-between; padding: 10px 16px; }
    .search-form { display: none; }
    .logo-section { margin-left: auto; }
    .container { padding: 10px 10px 14px; }
    body.page-video-list .container,
    body.page-video-detail .container {
        padding: 6px 6px 12px;
    }
    
    .home-header-link,
    .chat-header-link {
        border: 1px solid rgba(255,255,255,0.12);
        background: rgba(255,255,255,0.02);
    }

    .home-header-link {
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .home-header-link .home-header-text {
        display: none;
    }

    .home-header-link .home-header-icon {
        display: inline-block;
    }
    
    .home-header-link:hover,
    .chat-header-link:hover {
        border-color: rgba(255,255,255,0.16);
        background: rgba(255,255,255,0.05);
    }

    /* На мобилке в шапке: показываем "Все категории" вместо "Секс чат" */
    .topbar-categories-link { display: inline-flex; }
    .topbar-sexchat-link { display: none; }
    
    /* Показываем кнопки авторизации в сайдбаре */
    .sidebar-auth-buttons { display: flex; }
    .sidebar-user-profile.show { display: flex; }
    .sidebar-chat-btn { display: block; }
    
    /* Адаптивный логотип для мобильных */
    .sidebar-logo-img {
        max-width: 180px;
        max-height: 46px;
    }

    .sidebar-brand img {
        max-width: 180px !important;
        max-height: 46px !important;
    }
    
    /* Скрываем десктопные кнопки авторизации на мобилке */
    .top-links { display: none !important; }
}

/* ===== Responsive: Very Small Screens (< 360px) ===== */
@media (max-width: 360px) {
    .layout { grid-template-columns: 1fr; }
    
    .sidebar {
        width: 85vw;
        max-width: 280px;
        padding: 20px 12px;
    }
    
    .sidebar .sidebar-heading {
        font-size: 12px;
        margin: 0 0 12px;
        padding: 0 6px;
    }
    
    .sidebar .sidebar-heading.sidebar-heading-linklike {
        font-size: 12.5px;
        margin: 10px 0 4px;
        padding: 6px 8px;
    }
    
    .sidebar a {
        padding: 6px 8px;
        margin-bottom: 1px;
        font-size: 12.5px;
    }
    
    .sidebar .cat-count {
        min-width: 20px;
        padding: 2px 4px;
        font-size: 12px;
    }
    
    .topbar { padding: 8px 12px; gap: 8px; }
    .logo-section { display: flex; gap: 6px; }
    .container { padding: 8px 8px 12px; }
    body.page-video-list .container,
    body.page-video-detail .container {
        padding: 4px 4px 10px;
    }
    
    .home-header-link,
    .chat-header-link {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    .mobile-cat-toggle,
    .mobile-messages-toggle,
    .mobile-notifications-toggle,
    .mobile-search-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    .mobile-cat-toggle svg,
    .mobile-messages-toggle svg,
    .mobile-notifications-toggle svg,
    .mobile-search-toggle svg {
        width: 18px;
        height: 18px;
    }

    /* Mobile notifications dropdown */
    .notifications-dropdown {
        width: calc(100vw - 24px);
        max-width: 360px;
        max-height: 70vh;
    }

    .notifications-list {
        max-height: calc(70vh - 60px);
    }
    
    .sidebar-auth-btn {
        padding: 10px;
        font-size: 13px;
    }
    
    .sidebar-user-info {
        display: none;
    }
    
    .sidebar-user-profile.show {
        gap: 8px;
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .sidebar-user-avatar,
    .sidebar-user-avatar-default {
        width: 40px;
        height: 40px;
        border-width: 1px;
    }
}

/* ===== Cards ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    -webkit-mask: linear-gradient(#fff 0%, #fff 100%) content-box, linear-gradient(#fff 0%, #fff 100%);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
}

.card:hover::after {
    opacity: 1;
}

.thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1e2530, #14181f);
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.95rem;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

.card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.12);
    transition: all 0.2s ease;
}

.badge:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.18);
}

[data-theme="light"] .badge {
    background: var(--input-bg);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="light"] .badge:hover {
    background: var(--card);
    border-color: var(--border-light);
}

/* ===== Rating Badges ===== */
.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    white-space: nowrap;
}

.rating-badge.rating-tier-1 {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    border-color: rgba(255,255,255,0.25);
}

.rating-badge.rating-tier-2 {
    background: rgba(77,205,94,0.18);
    color: #7CFF9E;
    border-color: rgba(77,205,94,0.5);
}

.rating-badge.rating-tier-3 {
    background: rgba(80,160,255,0.18);
    color: #7FB7FF;
    border-color: rgba(80,160,255,0.5);
}

.rating-badge.rating-tier-4 {
    background: rgba(255,183,77,0.22);
    color: #ffd37a;
    border-color: rgba(255,183,77,0.6);
}

.rating-badge.rating-tier-5 {
    background: rgba(255,183,77,0.26);
    color: #ffd37a;
    border-color: rgba(255,183,77,0.9);
    box-shadow: 0 0 10px rgba(255,183,77,0.65), 0 0 18px rgba(255,183,77,0.4);
}

/* ===== Mentions ===== */
.mention-suggest {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 10px;
    background: rgba(12, 12, 14, 0.96);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0,0,0,0.45);
    padding: 8px;
    z-index: 30;
    max-height: 260px;
    overflow: auto;
    backdrop-filter: blur(10px);
}

.mention-suggest[hidden] {
    display: none !important;
}

.mention-item {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
}

.mention-item:hover,
.mention-item.is-active {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.16);
}

.mention-item .m-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
}

.mention-item .m-avatar-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    flex: 0 0 auto;
    font-size: 12px;
    text-transform: uppercase;
}

.mention-item .m-name {
    font-weight: 800;
    letter-spacing: 0.2px;
    font-size: 13px;
}

.mention-item .m-hint {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    opacity: 0.9;
}

.mention-item b {
    color: rgba(255,255,255,1);
    font-weight: 900;
}

a.mention,
span.mention {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(140, 160, 185, 0.16);
    border: 1px solid rgba(140, 175, 210, 0.22);
    color: rgba(180, 195, 215, 0.95);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

a.mention:hover {
    background: rgba(140, 160, 185, 0.22);
    color: rgba(200, 212, 228, 1);
}

/* ===== Reply Bar ===== */
.reply-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    margin-bottom: 8px;
}

.reply-bar[hidden] {
    display: none !important;
}

.reply-bar-main {
    flex: 1;
    min-width: 0;
    border-left: 3px solid rgba(255,255,255,0.55);
    padding-left: 10px;
}

.reply-bar-title {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-bottom: 3px;
}

.reply-bar-user {
    color: var(--text);
    font-weight: 800;
}

.reply-bar-snippet {
    font-size: 13px;
    color: var(--text);
    opacity: 0.92;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.reply-bar-cancel {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.reply-bar-cancel:hover {
    color: #fff;
    background: rgba(255,255,255,0.16);
}

/* ===== Wall ===== */
.wall-composer,
.wall-comment-form {
    position: relative;
}

.wall-composer textarea,
.wall-comment-form textarea {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
}

.wall-comment-form textarea {
    min-height: 64px;
    padding: 10px;
    border-radius: 10px;
}

.wall-composer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
}

.wall-submit-btn {
    padding: 7px 12px;
    font-size: 13px;
    background: linear-gradient(135deg, #515151, #3a3a3a);
    border: 1px solid rgba(255,255,255,0.10);
    color: #fff;
    box-shadow: none;
    text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

.wall-submit-btn:hover {
    background: linear-gradient(135deg, #747474, #4f4f4f);
    border-color: rgba(255,255,255,0.18);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255,255,255,0.16);
}

.wall-submit-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.14), 0 2px 10px rgba(255,255,255,0.14);
}

.wall-posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.wall-post {
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: 14px;
    padding: 12px;
}

.wall-post-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.wall-author {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.wall-author-avatar-wrap {
    position: relative;
    display: inline-block;
}

.wall-author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #404040, #303030);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 15px;
    line-height: 1;
}

.avatar-ban {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.16);
    display: grid;
    place-items: center;
    font-size: 12px;
}

.wall-author-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.wall-author-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wall-author-link,
.wall-author-name {
    text-decoration: none;
}

.wall-author-name {
    color: var(--text);
    font-weight: 900;
    letter-spacing: 0.2px;
}

.wall-author-name:hover {
    color: var(--accent);
}

.wall-username.is-banned {
    text-decoration: line-through;
    opacity: 0.78;
}

.profile-admin {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,183,77,0.18);
    border: 1px solid rgba(255,183,77,0.38);
    color: #ffd37a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.wall-date {
    font-size: 12px;
    color: var(--muted);
}

.wall-post-text {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dim);
    word-break: break-word;
}

.wall-post-actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.wall-toggle-comments {
    background: transparent;
    border: none;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.wall-action-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.wall-action-btn:hover {
    color: var(--text);
}

.wall-votes {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.wall-vote-btn {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    border-radius: 999px;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
}

.wall-vote-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
}

.wall-vote-btn.is-on {
    color: var(--text);
    border-color: rgba(255,255,255,0.38);
    background: rgba(255,255,255,0.12);
}

.wall-vote-ico {
    font-size: 13px;
    line-height: 1;
    opacity: 0.85;
}

.wall-comments {
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.wall-comments[hidden] {
    display: none !important;
}

.wall-comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    align-items: flex-start;
}

.wall-comment-body {
    flex: 1;
    min-width: 0;
}

.wall-comment-head {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.wall-reply-line {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    border-left: 3px solid rgba(255,255,255,0.55);
    color: var(--muted);
    font-size: 12px;
}

.wall-comment-text {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    word-break: break-word;
}

.wall-comment-meta {
    margin-top: 6px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}

.wall-info-wrap {
    position: relative;
}

.wall-info-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wall-info-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.wall-info-popover {
    position: absolute;
    top: 34px;
    right: 0;
    width: min(380px, 88vw);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    padding: 12px;
    z-index: 30;
}

.wall-info-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent var(--card) transparent;
}

.wall-info-popover-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wall-info-title {
    font-weight: 900;
}

.wall-info-popover p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

/* ===== Player ===== */
.player-wrapper { max-width: 980px; margin: 0; position: relative; z-index: 1; }

.player-wrapper video,
.player-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 900px) {
    .player-wrapper { max-width: 100%; }
    
    .player-wrapper video,
    .player-wrapper img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        background: #000;
        object-fit: contain;
    }
}

/* ===== Pagination ===== */
.pagination {
    margin-top: 32px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
    transform: translateY(-1px);
}

.page-btn.active {
    background: linear-gradient(135deg, rgba(122,146,176,0.15), rgba(122,146,176,0.08));
    border-color: rgba(122,146,176,0.3);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(122,146,176,0.15);
}

/* ===== Footer ===== */
footer {
    border-top: 1px solid var(--border);
    padding: 24px 24px;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: auto;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.2));
}

footer a {
    color: var(--text-dim);
    transition: all 0.2s ease;
}

footer a:hover {
    color: var(--accent);
}

/* ===== Auth Modals ===== */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 440px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease;
    z-index: 10000;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header .modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    color: var(--muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.auth-form {
    padding: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #505050;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}

.form-input::placeholder {
    color: var(--muted);
}

.form-error {
    color: #ff4757;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.form-error.active {
    display: block;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #404040, #303030);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255,255,255,0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--muted);
    font-size: 14px;
}

.form-switch a {
    color: #a0a0a0;
    font-weight: 600;
    text-decoration: none;
}

.form-switch a:hover {
    text-decoration: underline;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }

    .modal-header {
        padding: 20px 24px;
    }

    .auth-form {
        padding: 24px;
    }
}
/* ===== Theme Toggle Button ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-toggle:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.3s ease;
}

.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

/* Мобильная версия кнопки темы в сайдбаре */
.sidebar-theme-toggle {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-theme-toggle:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.sidebar-theme-toggle svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-theme-toggle .theme-label-dark {
    display: inline;
}

.sidebar-theme-toggle .theme-label-light {
    display: none;
}

[data-theme="light"] .sidebar-theme-toggle .theme-label-dark {
    display: none;
}

[data-theme="light"] .sidebar-theme-toggle .theme-label-light {
    display: inline;
}

@media (max-width: 900px) {
    .sidebar-theme-toggle {
        display: flex;
    }
}
