:root {
    --bg1: #18181b;
    --bg2: #27272a;
    --bg3: #3f3f46;
    --t1: #e4e4e7;
    --t2: #a1a1aa;
    --tm: #71717a;
    --bd: #27272a;
    --ac: #3b82f6;
    --ac2: #2563eb;
    --lk: #ef4444;
    --gr: #22c55e;
}

[data-theme="light"] {
    --bg1: #ffffff;
    --bg2: #f4f4f5;
    --bg3: #e4e4e7;
    --t1: #18181b;
    --t2: #52525b;
    --tm: #71717a;
    --bd: #e4e4e7;
}
/* ========== АВТОРИЗАЦИЯ - ПЕРЕЛИВАЮЩИЙСЯ ФОН ========== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}
/* ========== ПОЛНОЭКРАННАЯ АВТОРИЗАЦИЯ ========== */
.auth-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 1000;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.auth-fullscreen .auth-container {
    position: relative;
    z-index: 1;
    display: flex;
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Левая панель */
.auth-fullscreen .auth-info {
    flex: 1;
    padding: 48px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    backdrop-filter: blur(10px);
}

.auth-fullscreen .auth-info-content {
    color: white;
}

.auth-fullscreen .auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
}

.auth-fullscreen .auth-logo svg {
    stroke: white;
}

.auth-fullscreen .auth-logo span {
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-fullscreen .auth-tagline {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 40px;
    opacity: 0.95;
}

.auth-fullscreen .auth-description {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 48px;
}

.auth-fullscreen .feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.auth-fullscreen .feature-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-fullscreen .feature-icon svg {
    stroke: white;
}

.auth-fullscreen .feature-text h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.auth-fullscreen .feature-text p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.auth-fullscreen .auth-stats {
    display: flex;
    gap: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-fullscreen .stat {
    text-align: center;
}

.auth-fullscreen .stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-fullscreen .stat-label {
    font-size: 12px;
    opacity: 0.7;
}

/* Правая панель */
.auth-fullscreen .auth-card {
    width: 460px;
    padding: 48px;
    background: rgba(255, 255, 255, 0.98);
}

[data-theme="dark"] .auth-fullscreen .auth-card {
    background: rgba(30, 30, 35, 0.98);
}

.auth-fullscreen .auth-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-fullscreen .auth-card-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--t1);
}

.auth-fullscreen .auth-card-header p {
    color: var(--tm);
    font-size: 14px;
}

.auth-fullscreen .auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-fullscreen .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-fullscreen .form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--t1);
}

.auth-fullscreen .form-group small {
    font-size: 11px;
    color: var(--tm);
}

.auth-fullscreen .form-input {
    padding: 12px 16px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 12px;
    font-size: 14px;
    color: var(--t1);
    transition: all 0.2s;
}

.auth-fullscreen .form-input:focus {
    outline: none;
    border-color: var(--ac);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-fullscreen .btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.auth-fullscreen .error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: var(--lk);
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.auth-fullscreen .auth-card-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--bd);
}

.auth-fullscreen .auth-card-footer p {
    color: var(--tm);
    font-size: 14px;
    margin-bottom: 8px;
}

.auth-fullscreen .auth-link {
    color: var(--ac);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.auth-fullscreen .auth-link:hover {
    text-decoration: underline;
}

/* Адаптив */
@media (max-width: 968px) {
    .auth-fullscreen .auth-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .auth-fullscreen .auth-info {
        display: none;
    }
    
    .auth-fullscreen .auth-card {
        width: 100%;
        padding: 32px;
    }
}

@media (max-width: 480px) {
    .auth-fullscreen {
        padding: 20px;
    }
    
    .auth-fullscreen .auth-card {
        padding: 24px;
    }
    
    .auth-fullscreen .auth-card-header h2 {
        font-size: 28px;
    }
    
    .auth-fullscreen .form-input {
        padding: 10px 14px;
    }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', sans-serif;
    background: var(--bg1);
    color: var(--t1);
    min-height: 100vh;
}

.layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar-left {
    width: 260px;
    flex-shrink: 0;
    padding: 16px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--bd);
    overflow-y: auto;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    color: var(--t1);
    padding: 8px 16px 20px;
    cursor: pointer;
}

.logo span {
    color: var(--tm);
    font-size: 11px;
    font-weight: 500;
    vertical-align: super;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
    font-size: 15px;
    color: var(--t2);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg2);
    color: var(--t1);
}

.nav-item.active {
    background: var(--bg2);
    color: var(--t1);
    font-weight: 600;
}

.nav-item .icon {
    width: 20px;
    font-size: 18px;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--lk);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: var(--bd);
    margin: 10px 12px;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 6px;
    border-top: 1px solid var(--bd);
    margin-top: 20px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
}

.user-mini:hover {
    background: var(--bg2);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--t1);
    flex-shrink: 0;
}

.user-mini .avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

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

.user-mini .handle {
    font-size: 12px;
    color: var(--tm);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    max-width: 600px;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========== TYPOGRAPHY ========== */
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ========== TABS ========== */
.feed-tabs,
.profile-tabs,
.group-tabs {
    display: flex;
    gap: 0;
    background: var(--bg2);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab {
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    color: var(--t2);
    border: none;
    background: transparent;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--t1);
    background: var(--bg3);
}

.tab.active {
    background: var(--bg3);
    color: var(--t1);
}

/* ========== BUTTONS ========== */
.btn-primary {
    background: var(--ac);
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--ac2);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg3);
    color: var(--t1);
    border: none;
    padding: 9px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-danger {
    background: var(--lk);
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

.btn-block {
    width: 100%;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--t2);
    margin-bottom: 6px;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--bd);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--t1);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--ac);
    background: var(--bg2);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--tm);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

/* ========== AUTH PAGES ========== */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
}

.auth-card {
    background: var(--bg2);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-text {
    font-size: 36px;
    font-weight: 800;
    color: var(--t1);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--tm);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--tm);
}

.auth-link {
    color: var(--ac);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.auth-link:hover {
    text-decoration: underline;
}

.error-msg {
    color: var(--lk);
    font-size: 13px;
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    text-align: center;
}

/* ========== POST CARD ========== */
.post-card {
    background: var(--bg2);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.post-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px 10px;
    position: relative;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
    text-decoration: none;
}

.post-user-info {
    flex: 1;
    cursor: pointer;
}

.post-username {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.verified-badge {
    width: 16px;
    height: 16px;
    background: var(--ac);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
}

.post-handle {
    font-size: 13px;
    color: var(--tm);
}

.post-time {
    font-size: 12px;
    color: var(--tm);
}

.post-content {
    padding: 0 16px 14px;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-image {
    width: 100%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.post-image-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 8px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px 14px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 20px;
    border: none;
    background: transparent;
    color: var(--tm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg3);
    color: var(--t2);
}

.action-btn.liked {
    color: var(--lk);
}

.action-btn .count {
    font-size: 13px;
}

.post-actions .spacer {
    flex: 1;
}

.views-count {
    font-size: 12px;
    color: var(--tm);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== МЕНЮ ПОСТА (ТРИ ТОЧКИ) ========== */
.post-menu {
    position: relative;
    margin-left: auto;
}

.post-menu-btn {
    background: none;
    border: none;
    color: var(--tm);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
}

.post-menu-btn:hover {
    background: var(--bg3);
    color: var(--t1);
}

.post-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-direction: column;
}

.post-menu-dropdown button {
    background: none;
    border: none;
    padding: 10px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--t1);
    transition: all 0.2s;
    width: 100%;
}

.post-menu-dropdown button:hover {
    background: var(--bg3);
}

.edit-post-btn {
    color: var(--ac) !important;
}

.delete-post-btn {
    color: var(--lk) !important;
}

/* ========== COMMENTS ========== */
.comments-section {
    padding: 14px 16px 16px;
    border-top: 1px solid var(--bd);
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    position: relative;
    animation: slideIn 0.2s ease;
}

.comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
}

.comment-body {
    flex: 1;
    background: var(--bg3);
    border-radius: 16px;
    padding: 10px 14px;
    position: relative;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    cursor: pointer;
}

.comment-author:hover {
    text-decoration: underline;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 6px;
    word-break: break-word;
}

.comment-image {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
}

.comment-time {
    font-size: 11px;
    color: var(--tm);
    margin-top: 4px;
}

.delete-comment-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    background: var(--bg2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--tm);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}

.delete-comment-btn:hover {
    background: var(--lk);
    color: #fff;
}

.comment-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    background: var(--bg3);
    border-radius: 24px;
    padding: 6px 12px;
}

.comment-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    color: var(--t1);
    font-size: 14px;
    outline: none;
}

.comment-image-btn {
    background: var(--bg2);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--tm);
}

.comment-image-btn:hover {
    background: var(--ac);
    color: #fff;
}

.comment-send {
    background: var(--ac);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.comment-send:hover {
    background: var(--ac2);
    transform: scale(1.02);
}

/* ========== CREATE POST ========== */
.create-post {
    background: var(--bg2);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
}

.create-post-top {
    display: flex;
    gap: 12px;
}

.create-post-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ac), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.create-post-input {
    flex: 1;
    background: var(--bg3);
    border: none;
    border-radius: 24px;
    padding: 11px 16px;
    color: var(--t1);
    font-size: 15px;
    cursor: pointer;
    text-align: left;
}

.create-post-input:hover {
    background: var(--bd);
}

/* ========== PROFILE ========== */
.profile-header {
    background: var(--bg2);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.profile-info {
    padding: 0 20px 20px;
    position: relative;
}

.profile-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    color: var(--t1);
    flex-shrink: 0;
    margin-top: -45px;
    border: 4px solid var(--bg2);
}

.profile-top-info {
    flex: 1;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-handle {
    font-size: 14px;
    color: var(--tm);
    margin-bottom: 10px;
}

.profile-bio {
    font-size: 14px;
    line-height: 1.5;
    color: var(--t1);
    margin-bottom: 8px;
}

.profile-location {
    font-size: 13px;
    color: var(--tm);
    margin-bottom: 4px;
}

.profile-joined {
    font-size: 12px;
    color: var(--tm);
}

.profile-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.profile-stat {
    cursor: pointer;
}

.profile-stat-value {
    font-weight: 700;
    font-size: 18px;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--tm);
}

.profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-stats {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    border-top: 1px solid var(--bd);
    background: var(--bg2);
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--tm);
}

/* ========== MESSAGES ========== */
.messenger-layout {
    display: flex;
    height: calc(100vh - 100px);
    background: var(--bg2);
    border-radius: 24px;
    overflow: hidden;
}

.messenger-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--bd);
    display: flex;
    flex-direction: column;
    background: var(--bg2);
}

.messenger-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--bd);
}

.messenger-sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.new-chat-btn {
    background: var(--bg3);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    color: var(--t1);
}

.new-chat-btn:hover {
    background: var(--ac);
    transform: scale(1.05);
}

.messenger-search {
    padding: 12px 16px;
}

.messenger-search-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--bd);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--t1);
    font-size: 14px;
    outline: none;
}

.messenger-chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.messenger-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.messenger-chat-item:hover {
    background: var(--bg3);
}

.messenger-chat-item.active {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
}

.messenger-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.messenger-chat-info {
    flex: 1;
    min-width: 0;
}

.messenger-chat-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.messenger-chat-last {
    font-size: 13px;
    color: var(--tm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-chat-me {
    color: var(--ac);
    font-weight: 500;
}

.messenger-chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.messenger-chat-time {
    font-size: 11px;
    color: var(--tm);
}

.messenger-chat-unread {
    background: var(--ac);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.messenger-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg1);
}

.messenger-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bd);
    background: var(--bg2);
}

.messenger-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.messenger-chat-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.messenger-chat-header-name {
    font-weight: 700;
    font-size: 16px;
}

.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
}

.messenger-back-btn {
    background: var(--bg3);
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--t1);
    display: none;
}

.messenger-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.messenger-message {
    display: flex;
    gap: 10px;
    max-width: 70%;
}

.messenger-message-out {
    align-self: flex-end;
    margin-left: auto;
}

.messenger-message-in {
    align-self: flex-start;
    margin-right: auto;
}

.messenger-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    align-self: flex-end;
}

.messenger-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}

.messenger-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--tm);
    padding-left: 4px;
}

.messenger-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    max-width: 100%;
}

.bubble-out {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble-in {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

.messenger-message-text {
    font-size: 14px;
    line-height: 1.4;
}

.messenger-message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

.messenger-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--bd);
    background: var(--bg2);
}

.messenger-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.messenger-input {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--bd);
    border-radius: 24px;
    padding: 12px 18px;
    color: var(--t1);
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: inherit;
    max-height: 100px;
}

.messenger-input:focus {
    border-color: var(--ac);
}

.messenger-send-btn {
    background: var(--ac);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.messenger-send-btn:hover {
    background: var(--ac2);
    transform: scale(1.02);
}

.empty-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--tm);
}

.empty-chat-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* ========== GROUPS ========== */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.group-card {
    background: var(--bg2);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.group-card:hover {
    transform: translateY(-4px);
}

.group-cover-card {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
}

.group-members-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.group-info-card {
    padding: 12px;
}

.group-name-card {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.group-desc-card {
    font-size: 12px;
    color: var(--tm);
    margin-bottom: 8px;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.member-card:hover {
    background: var(--bg3);
    transform: translateY(-2px);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    font-size: 15px;
}

.member-handle {
    font-size: 12px;
    color: var(--tm);
}

.role-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: var(--bg3);
    border-radius: 12px;
    margin-top: 4px;
    color: var(--t2);
}

/* ========== EVENTS ========== */
.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card {
    background: var(--bg2);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.event-date {
    width: 60px;
    height: 60px;
    background: var(--bg3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-date .day {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.event-date .month {
    font-size: 11px;
    color: var(--tm);
    text-transform: uppercase;
}

.event-info {
    flex: 1;
}

.event-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.event-meta {
    font-size: 13px;
    color: var(--tm);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.event-actions {
    display: flex;
    gap: 8px;
}

/* ========== MARKETPLACE ========== */
.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 6px 14px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 20px;
    color: var(--t2);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--ac);
    color: #fff;
    border-color: var(--ac);
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.market-card {
    background: var(--bg2);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s;
}

.market-card:hover {
    transform: translateY(-4px);
}

.market-img {
    height: 160px;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.market-info {
    padding: 12px;
}

.market-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.market-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--ac);
    margin-bottom: 8px;
}

.market-seller {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--tm);
    cursor: pointer;
}

.market-seller:hover {
    color: var(--t1);
}

.mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
}

/* ========== BOOKMARKS ========== */
.bookmark-folders {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.folder {
    padding: 10px 18px;
    background: var(--bg2);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.folder:hover,
.folder.active {
    background: var(--bg3);
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bookmark-card {
    background: var(--bg2);
    border-radius: 14px;
    padding: 16px;
    position: relative;
}

.bookmark-content {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--t2);
}

.bookmark-meta {
    font-size: 12px;
    color: var(--tm);
    display: flex;
    justify-content: space-between;
}

.remove-bookmark {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg3);
    color: var(--t2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.remove-bookmark:hover {
    background: var(--lk);
    color: #fff;
}

/* ========== NOTIFICATIONS ========== */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg2);
    border-radius: 12px;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg3);
}

.notification-item.unread {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
}

.notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.notification-content {
    flex: 1;
}

.notification-text {
    font-size: 14px;
    margin-bottom: 4px;
}

.notification-text strong {
    font-weight: 700;
}

.notification-time {
    font-size: 12px;
    color: var(--tm);
}

/* ========== SETTINGS ========== */
.settings-section {
    background: var(--bg2);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}

.settings-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.settings-section.danger {
    border: 1px solid var(--lk);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--bd);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.setting-value {
    font-size: 13px;
    color: var(--tm);
}

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-block;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg3);
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--ac);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ========== MODALS ========== */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-container.show {
    display: flex;
}

.modal {
    background: var(--bg2);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.2s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--bd);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--tm);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--t1);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--bd);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed var(--bd);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.file-upload:hover {
    border-color: var(--ac);
    background: rgba(59, 130, 246, 0.05);
}

.file-preview {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg2);
    color: var(--t1);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--bd);
}

.toast.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

.toast-success {
    border-left: 4px solid var(--gr);
}

.toast-error {
    border-left: 4px solid var(--lk);
}

/* ========== LOADING & EMPTY STATES ========== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--tm);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--bd);
    border-top-color: var(--ac);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--tm);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--t1);
}

.empty-state p {
    font-size: 14px;
}

.end-of-feed {
    text-align: center;
    padding: 20px;
    color: var(--tm);
    font-size: 13px;
}

.error-state {
    text-align: center;
    padding: 40px;
    color: var(--lk);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg3);
    border-top-color: var(--ac);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== ANIMATIONS ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RIGHT SIDEBAR ========== */
.sidebar-right {
    width: 280px;
    flex-shrink: 0;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid var(--bd);
}

.sidebar-right-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.trending-section,
.suggestions-section {
    background: var(--bg2);
    border-radius: 16px;
    padding: 16px;
}

.trending-section h3,
.suggestions-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--t2);
    margin-bottom: 12px;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 6px 0;
}

.trending-item:hover {
    color: var(--ac);
}

.trending-tag {
    font-size: 13px;
    font-weight: 500;
    color: var(--t1);
}

.trending-count {
    font-size: 11px;
    color: var(--tm);
}

.suggestion-item {
    padding: 10px 0;
    font-size: 13px;
    color: var(--t2);
    cursor: pointer;
    border-bottom: 1px solid var(--bd);
}

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

.suggestion-item:hover {
    color: var(--ac);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
}

.footer-links a {
    font-size: 12px;
    color: var(--tm);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--ac);
}

.copyright {
    font-size: 11px;
    color: var(--tm);
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid var(--bd);
    line-height: 1.5;
}

.theme-toggle-btn {
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    background: var(--bg3);
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

/* ========== LOGOUT BUTTON ========== */
.logout-btn {
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-size: 15px;
    color: var(--t2);
    margin-top: 8px;
}

.logout-btn:hover {
    background: var(--bg2);
    color: var(--lk);
}

/* ========== USER SEARCH ========== */
.user-search-results {
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.user-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-search-item:hover {
    background: var(--bg3);
}

.user-search-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

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

.user-search-handle {
    font-size: 12px;
    color: var(--tm);
}

.back-btn {
    background: var(--bg3);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--t1);
    font-size: 14px;
    margin-bottom: 16px;
}

.back-btn:hover {
    background: var(--bd);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar-left {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        z-index: 100;
        background: var(--bg1);
        border-top: 1px solid var(--bd);
        border-right: none;
        padding: 8px 12px;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .sidebar-left .logo,
    .sidebar-left .nav-divider,
    .sidebar-left .sidebar-bottom .theme-toggle-btn {
        display: none;
    }
    
    .nav-list {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .nav-item span:last-child {
        display: none;
    }
    
    .nav-item .icon {
        font-size: 22px;
    }
    
    .main-content {
        margin-bottom: 70px;
        padding: 16px;
        max-width: 100%;
    }
    
    .sidebar-right {
        display: none;
    }
    
    .messenger-layout {
        flex-direction: column;
        height: auto;
        border-radius: 0;
    }
    
    .messenger-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bd);
    }
    
    .messenger-back-btn {
        display: flex;
    }
    
    .messenger-message {
        max-width: 85%;
    }
    
    .modal {
        width: 95%;
        margin: 20px;
    }
    
    .post-menu-dropdown {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        width: auto;
        border-radius: 16px;
    }
    
    .delete-comment-btn {
        opacity: 1;
    }
}
/* ========== ПРИНУДИТЕЛЬНОЕ СКРЫТИЕ ЛОАДЕРА ========== */
.loading-overlay {
    display: none !important;
}

.loading-overlay[hidden] {
    display: none !important;
}

.loading-overlay:not([hidden]) {
    display: none !important;
}

/* Если лоадер все равно появляется - скрываем */
#loading-overlay {
    display: none !important;
}
/* ========== COMMENTS ========== */
.comments-section {
    padding: 14px 16px 16px;
    border-top: 1px solid var(--bd);
    background: var(--bg1);
    border-radius: 0 0 16px 16px;
}

.comments-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Комментарий */
.comment {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    position: relative;
    animation: slideIn 0.2s ease;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.comment-avatar:hover {
    transform: scale(1.05);
}

.comment-body {
    flex: 1;
    background: var(--bg3);
    border-radius: 18px;
    padding: 10px 14px;
    position: relative;
    max-width: calc(100% - 48px);
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    cursor: pointer;
    display: inline-block;
    color: var(--ac);
}

.comment-author:hover {
    text-decoration: underline;
}

.comment-text {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 6px;
    word-break: break-word;
    color: var(--t1);
}

/* Фото в комментарии - ОГРАНИЧЕННЫЙ РАЗМЕР */
.comment-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.2s, opacity 0.2s;
    border: 1px solid var(--bd);
}

.comment-image:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

/* Предпросмотр фото перед отправкой */
.comment-image-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 12px;
    margin-top: 8px;
    position: relative;
    display: inline-block;
}

.comment-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.comment-image-preview .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--lk);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-time {
    font-size: 10px;
    color: var(--tm);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Кнопка удаления комментария */
.delete-comment-btn {
    position: absolute;
    right: 8px;
    top: 8px;
    background: var(--bg2);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    color: var(--tm);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}

.delete-comment-btn:hover {
    background: var(--lk);
    color: #fff;
    transform: scale(1.1);
}

/* Форма добавления комментария */
.comment-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    background: var(--bg2);
    border-radius: 24px;
    padding: 6px 12px;
    border: 1px solid var(--bd);
    transition: border-color 0.2s;
}

.comment-input-row:focus-within {
    border-color: var(--ac);
}

.comment-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    color: var(--t1);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.comment-input::placeholder {
    color: var(--tm);
}

/* Кнопка добавления фото */
.comment-image-btn {
    background: var(--bg3);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--tm);
    flex-shrink: 0;
}

.comment-image-btn:hover {
    background: var(--ac);
    color: #fff;
    transform: scale(1.05);
}

/* Кнопка отправки */
.comment-send {
    background: var(--ac);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.comment-send:hover {
    background: var(--ac2);
    transform: scale(1.05);
}

.comment-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Контейнер для превью фото */
.comment-preview-container {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .comment-body {
        max-width: calc(100% - 44px);
    }
    
    .comment-image {
        max-width: 150px;
        max-height: 150px;
    }
    
    .delete-comment-btn {
        opacity: 1;
        background: var(--bg3);
    }
    
    .comment-input-row {
        padding: 6px 10px;
    }
    
    .comment-image-btn,
    .comment-send {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}
/* ========== ИКОНКИ ОДНОТОННЫЕ ========== */
.icon,
.nav-item .icon,
.action-btn,
.comment-image-btn,
.comment-send,
.send-btn,
.messenger-send-btn,
.btn-primary .icon,
.btn-secondary .icon {
    background: transparent !important;
    filter: none !important;
}

/* Убираем градиенты с иконок */
.post-avatar,
.comment-avatar,
.messenger-chat-avatar,
.messenger-chat-header-avatar {
    background: var(--bg3) !important;
}

/* ========== СООБЩЕНИЯ - ИСПРАВЛЕННЫЕ СТИЛИ ========== */
.messenger-layout {
    display: flex;
    height: calc(100vh - 120px);
    background: var(--bg2);
    border-radius: 20px;
    overflow: hidden;
}

.messenger-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--bd);
    display: flex;
    flex-direction: column;
    background: var(--bg2);
}

.messenger-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--bd);
}

.messenger-sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.new-chat-btn {
    background: var(--bg3);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    color: var(--t1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-chat-btn:hover {
    background: var(--ac);
    transform: scale(1.05);
}

.messenger-search {
    padding: 12px 16px;
}

.messenger-search-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--bd);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--t1);
    font-size: 14px;
    outline: none;
}

.messenger-search-input:focus {
    border-color: var(--ac);
}

.messenger-chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.messenger-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s;
    position: relative;
}

.messenger-chat-item:hover {
    background: var(--bg3);
}

.messenger-chat-item.active {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
}

.messenger-chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.messenger-chat-info {
    flex: 1;
    min-width: 0;
}

.messenger-chat-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.messenger-chat-last {
    font-size: 13px;
    color: var(--tm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-chat-me {
    color: var(--ac);
    font-weight: 500;
}

.messenger-chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.messenger-chat-time {
    font-size: 11px;
    color: var(--tm);
}

.messenger-chat-unread {
    background: var(--ac);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}

.messenger-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg1);
}

.messenger-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bd);
    background: var(--bg2);
}

.messenger-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.messenger-chat-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.messenger-chat-header-details {
    display: flex;
    flex-direction: column;
}

.messenger-chat-header-name {
    font-weight: 700;
    font-size: 16px;
}

.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
}

.messenger-back-btn {
    background: var(--bg3);
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--t1);
    display: none;
    align-items: center;
    justify-content: center;
}

.messenger-back-btn:hover {
    background: var(--bd);
}

.messenger-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.messenger-message {
    display: flex;
    max-width: 75%;
}

.messenger-message-out {
    align-self: flex-end;
    justify-content: flex-end;
}

.messenger-message-in {
    align-self: flex-start;
    justify-content: flex-start;
}

.messenger-message-content {
    max-width: 100%;
}

.messenger-message-sender {
    font-size: 11px;
    font-weight: 600;
    color: var(--tm);
    margin-bottom: 2px;
    padding-left: 4px;
}

.messenger-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    max-width: 100%;
}

.messenger-message-out .messenger-message-bubble {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.messenger-message-in .messenger-message-bubble {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

.messenger-message-text {
    font-size: 14px;
    line-height: 1.4;
}

.messenger-message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

.messenger-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--bd);
    background: var(--bg2);
}

.messenger-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.messenger-input {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--bd);
    border-radius: 24px;
    padding: 12px 18px;
    color: var(--t1);
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: inherit;
    max-height: 100px;
}

.messenger-input:focus {
    border-color: var(--ac);
}

.messenger-send-btn {
    background: var(--ac);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    font-size: 18px;
}

.messenger-send-btn:hover {
    background: var(--ac2);
    transform: scale(1.02);
}

.empty-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--tm);
}

.empty-chat-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-chat h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--t1);
}

.empty-chat p {
    font-size: 14px;
}

/* Адаптивность для сообщений */
@media (max-width: 768px) {
    .messenger-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .messenger-sidebar.active {
        transform: translateX(0);
    }
    
    .messenger-back-btn {
        display: flex;
    }
    
    .messenger-message {
        max-width: 85%;
    }
    
    .messenger-chat-header {
        padding: 12px 16px;
    }
    
    .messenger-messages {
        padding: 16px;
    }
    
    .messenger-input-area {
        padding: 12px 16px;
    }
}

/* ========== ВЫРАВНИВАНИЕ ЭЛЕМЕНТОВ ========== */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.post-user-info {
    flex: 1;
    cursor: pointer;
}

.post-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--tm);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px 12px;
}

.post-actions .spacer {
    flex: 1;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
}

.profile-top-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.profile-stats {
    display: flex;
    gap: 32px;
    margin: 16px 0;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.comment {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

.comment-body {
    flex: 1;
}

.comment-time {
    font-size: 11px;
    color: var(--tm);
    margin-top: 4px;
}

/* Пост на стене пользователя */
.create-post-wall {
    background: var(--bg2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

.create-post-wall .create-post-top {
    display: flex;
    gap: 12px;
    align-items: center;
}

.create-post-wall .create-post-input {
    flex: 1;
    background: var(--bg3);
    border: none;
    border-radius: 24px;
    padding: 12px 16px;
    color: var(--t1);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

.create-post-wall .create-post-input:hover {
    background: var(--bd);
}

/* ========== ПРОФИЛЬ - ИСПРАВЛЕННАЯ АВАТАРКА ========== */
.profile-header {
    background: var(--bg2);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}

.profile-cover {
    height: 150px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    position: relative;
}

.profile-info {
    padding: 0 20px 20px;
    position: relative;
}

.profile-top-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-top: -50px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 4px solid var(--bg2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    bottom: -10px;
}

.profile-avatar[style*="background"] {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.profile-top-info {
    flex: 1;
    min-width: 200px;
    padding-bottom: 8px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-handle {
    font-size: 14px;
    color: var(--tm);
    margin-bottom: 8px;
}

.profile-bio {
    font-size: 14px;
    line-height: 1.5;
    color: var(--t1);
    margin-bottom: 8px;
}

.profile-location {
    font-size: 13px;
    color: var(--tm);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-joined {
    font-size: 12px;
    color: var(--tm);
}

.profile-stats {
    display: flex;
    gap: 32px;
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid var(--bd);
    border-bottom: 1px solid var(--bd);
}

.profile-stat {
    cursor: pointer;
    text-align: center;
}

.profile-stat-value {
    font-weight: 700;
    font-size: 20px;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--tm);
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .profile-top-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -40px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        min-width: 80px;
        font-size: 36px;
        bottom: -5px;
    }
    
    .profile-top-info {
        text-align: center;
    }
    
    .profile-name {
        justify-content: center;
    }
    
    .profile-stats {
        justify-content: center;
        gap: 24px;
    }
    
    .profile-actions {
        justify-content: center;
    }
}

/* Общие стили для аватарок везде */
.post-avatar,
.comment-avatar,
.messenger-chat-avatar,
.messenger-chat-header-avatar,
.avatar,
.mini-avatar,
.member-avatar,
.user-search-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
    font-weight: 600;
}

.post-avatar {
    width: 44px;
    height: 44px;
    font-size: 18px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.messenger-chat-avatar,
.messenger-chat-header-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.mini-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.member-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.user-search-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
}
/* ========== УВЕДОМЛЕНИЯ ========== */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.notifications-header .page-title {
    margin-bottom: 0;
}

.mark-all-read-btn {
    background: var(--bg3);
    border: 1px solid var(--bd);
    color: var(--t1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mark-all-read-btn:hover {
    background: var(--ac);
    border-color: var(--ac);
    color: #fff;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg2);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.notification-item:hover {
    background: var(--bg3);
    transform: translateX(4px);
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--ac);
}

.notification-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
    color: var(--t1);
}

.notification-text strong {
    font-weight: 700;
    color: var(--ac);
}

.notification-time {
    font-size: 11px;
    color: var(--tm);
}

.notification-unread-dot {
    width: 10px;
    height: 10px;
    background: var(--ac);
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--tm);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--t1);
}

.empty-state p {
    font-size: 14px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .notifications-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .notification-item {
        padding: 12px;
    }
    
    .notification-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
/* ========== ИКОНКИ В САЙДБАРЕ ========== */
.nav-item .icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.2s;
}

.nav-item:hover .icon {
    stroke: var(--t1);
    transform: scale(1.05);
}

.nav-item.active .icon {
    stroke: var(--ac);
    stroke-width: 2.5;
}

/* Иконка темы */
.theme-toggle-btn .icon {
    width: 18px;
    height: 18px;
}

/* Кнопка выхода */
.logout-btn .icon {
    stroke: var(--tm);
}

.logout-btn:hover .icon {
    stroke: var(--lk);
}
/* ========== КНОПКИ ИЗМЕНЕНИЯ ОБЛОЖКИ И АВАТАРА ========== */
.profile-cover {
    position: relative;
    min-height: 150px;
}

.change-cover-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
    z-index: 10;
}

.change-cover-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.02);
}

.change-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.change-avatar-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.profile-avatar {
    position: relative;
}
.upload-hint {
    font-size: 12px;
    color: var(--tm);
    margin-top: 8px;
    text-align: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}
.market-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--tm);
    cursor: pointer;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--bd);
}

.market-seller-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.market-seller-avatar img,
.market-seller-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: #fff;
}

.market-seller:hover {
    color: var(--ac);
}
/* ========== ГРУППЫ ========== */
.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.group-card {
    background: var(--bg2);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.group-cover-card {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-size: cover;
    background-position: center;
}

.group-emoji {
    font-size: 48px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.group-members-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.group-info-card {
    padding: 14px;
}

.group-name-card {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--t1);
}

.group-desc-card {
    font-size: 13px;
    color: var(--tm);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Страница группы */
.group-header {
    background: var(--bg2);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
}

.group-cover {
    height: 180px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.change-group-cover-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.change-group-cover-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.group-info {
    padding: 20px;
}

.group-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.group-icon {
    width: 70px;
    height: 70px;
    background: var(--bg3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.group-details {
    flex: 1;
}

.group-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.group-meta {
    font-size: 13px;
    color: var(--tm);
}

.group-desc {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    color: var(--t2);
}

.group-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bd);
}

.group-stat {
    text-align: center;
}

.group-stat-value {
    font-weight: 700;
    font-size: 20px;
}

.group-stat-label {
    font-size: 12px;
    color: var(--tm);
}

.group-actions {
    display: flex;
    gap: 12px;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg2);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.member-card:hover {
    background: var(--bg3);
    transform: translateX(4px);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.member-avatar img,
.member-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.member-handle {
    font-size: 12px;
    color: var(--tm);
}

.role-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: var(--bg3);
    border-radius: 12px;
    margin-top: 4px;
    color: var(--ac);
}

.back-btn {
    background: var(--bg3);
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--t1);
    margin-bottom: 20px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--bd);
}
/* Индикатор печати */
.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
    transition: all 0.2s ease;
}

.messenger-chat-header-status.typing {
    color: var(--ac);
    font-style: italic;
}

@keyframes typingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg3);
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 8px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--tm);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}
/* ========== ПРЕВЬЮ ССЫЛОК ========== */
.message-link {
    color: var(--ac);
    text-decoration: none;
    border-bottom: 1px dashed var(--ac);
}

.message-link:hover {
    text-decoration: underline;
}

.link-preview {
    display: flex;
    margin-top: 8px;
    border: 1px solid var(--bd);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg2);
    max-width: 400px;
}

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

.link-preview-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg3);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    padding: 10px 12px;
    min-width: 0;
}

.link-preview-site {
    font-size: 11px;
    color: var(--tm);
    text-transform: uppercase;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--t1);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-description {
    font-size: 12px;
    color: var(--t2);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 11px;
    color: var(--tm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Для исходящих сообщений */
.messenger-message-out .link-preview {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .link-preview {
        max-width: 280px;
    }
    
    .link-preview-image {
        width: 80px;
        height: 80px;
    }
    
    .link-preview-title {
        font-size: 13px;
    }
    
    .link-preview-description {
        font-size: 11px;
    }
}
/* ========== ПРЕВЬЮ ССЫЛОК ========== */
.message-link {
    color: var(--ac);
    text-decoration: none;
    border-bottom: 1px dashed var(--ac);
}

.message-link:hover {
    text-decoration: underline;
}

.link-preview {
    display: flex;
    margin-top: 10px;
    border: 1px solid var(--bd);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg2);
    max-width: 380px;
}

.link-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--ac);
}

.link-preview-simple {
    min-width: 200px;
}

.link-preview-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg3);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    padding: 10px 12px;
    min-width: 0;
}

.link-preview-site {
    font-size: 11px;
    color: var(--tm);
    text-transform: uppercase;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.3px;
}

.link-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--t1);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.link-preview-description {
    font-size: 12px;
    color: var(--t2);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.link-preview-url {
    font-size: 11px;
    color: var(--tm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Для исходящих сообщений */
.messenger-message-out .link-preview {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.messenger-message-out .link-preview:hover {
    border-color: var(--ac);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .link-preview {
        max-width: 280px;
    }
    
    .link-preview-image {
        width: 80px;
        height: 80px;
    }
    
    .link-preview-title {
        font-size: 13px;
    }
    
    .link-preview-description {
        font-size: 11px;
        -webkit-line-clamp: 1;
    }
}
/* Скрываем правый сайдбар только на странице сообщений */
body.messages-page .sidebar-right {
    display: none !important;
}

body.messages-page .main-content {
    max-width: 100% !important;
    padding: 0 !important;
}

body.messages-page .messenger-layout {
    height: calc(100vh - 80px);
    border-radius: 0;
}

/* Стили для фото в сообщениях */
.message-image {
    max-width: 250px;
    max-height: 250px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-image-attachment {
    display: inline-block;
    margin-top: 8px;
}

/* Индикатор загрузки фото */
.image-upload-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 12px;
    margin-top: 8px;
    position: relative;
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.image-upload-preview .remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--lk);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Кнопка прикрепления фото */
.attach-image-btn {
    background: var(--bg3);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--tm);
    flex-shrink: 0;
}

.attach-image-btn:hover {
    background: var(--ac);
    color: #fff;
    transform: scale(1.05);
}
body.messages-page .sidebar-right {
    display: none !important;
}

body.messages-page .main-content {
    max-width: 100% !important;
    padding: 0 !important;
}

body.messages-page .messenger-layout {
    height: calc(100vh - 80px);
    border-radius: 0;
}
/* Анимированные три точки для индикатора печати */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 3px;
    height: 3px;
    background-color: none;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
/* Стили для мессенджера */
.messenger-layout {
    display: flex;
    height: calc(100vh - 80px);
    background: var(--bg2);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

/* Правая граница для конца окна */
.messenger-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg1);
    position: relative;
    border-right: 1px solid var(--bd);
}

.messenger-main::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--bd), transparent);
}

/* Индикатор печати - без скачков */
.messenger-chat-header-status {
    font-size: 13px;
    color: var(--tm);
    transition: all 0.2s ease;
    min-height: 20px;
    display: flex;
    align-items: center;
}

.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.typing-text {
    color: var(--ac);
    font-size: 13px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background-color: var(--ac);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .messenger-layout {
        height: calc(100vh - 60px);
        border-radius: 0;
    }
    
    .messenger-main::after {
        display: none;
    }
    
    .typing-indicator-wrapper {
        font-size: 11px;
    }
    
    .typing-text {
        font-size: 11px;
    }
}
/* Стили для стикеров */
.sticker-btn {
    background: var(--bg3);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--tm);
    flex-shrink: 0;
}

.sticker-btn:hover {
    background: var(--ac);
    color: #fff;
    transform: scale(1.05);
}

.stickers-panel {
    position: absolute;
    bottom: 70px;
    left: 20px;
    right: 20px;
    background: var(--bg2);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    flex-direction: column;
    border: 1px solid var(--bd);
}

.stickers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bd);
}

.stickers-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.close-stickers-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--tm);
    padding: 0 4px;
}

.close-stickers-btn:hover {
    color: var(--t1);
}

.stickers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 12px;
}

.sticker-item {
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s;
    background: var(--bg3);
}

.sticker-item:hover {
    transform: scale(1.1);
    background: var(--ac);
}

/* Индикатор печати */
.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.typing-text {
    color: var(--ac);
    font-size: 13px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background-color: var(--ac);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .stickers-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .sticker-item {
        font-size: 28px;
    }
    
    .typing-indicator-wrapper {
        font-size: 11px;
    }
    
    .typing-text {
        font-size: 11px;
    }
}
.encryption-badge {
    font-size: 11px;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.decrypt-error {
    color: var(--lk);
    font-style: italic;
}

.decrypt-error-bubble {
    background: rgba(239, 68, 68, 0.1) !important;
}
/* Мессенджер */
.messenger-container {
    display: flex;
    height: calc(100vh - 80px);
    background: var(--bg2);
    border-radius: 16px;
    overflow: hidden;
}

/* Список чатов */
.chats-sidebar {
    width: 320px;
    border-right: 1px solid var(--bd);
    display: flex;
    flex-direction: column;
    background: var(--bg2);
}

.chats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--bd);
}

.chats-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.new-chat-btn {
    background: var(--bg3);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: var(--t1);
}

.chats-search {
    padding: 12px 16px;
}

.chats-search input {
    width: 100%;
    background: var(--bg3);
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--t1);
    font-size: 14px;
}

.chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-item:hover {
    background: var(--bg3);
}

.chat-item.active {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-avatar img, .chat-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.chat-preview {
    font-size: 13px;
    color: var(--tm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-me {
    color: var(--ac);
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.chat-time {
    font-size: 11px;
    color: var(--tm);
}

.chat-unread {
    background: var(--ac);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
}

/* Область чата */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg1);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bd);
    background: var(--bg2);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
}

.chat-header-avatar img, .chat-header-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.chat-header-name {
    font-weight: 700;
    font-size: 16px;
}

.chat-header-status {
    font-size: 12px;
    color: var(--tm);
}

.chat-back-btn {
    background: var(--bg3);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    color: var(--t1);
    display: none;
}

/* Сообщения */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    display: flex;
    max-width: 70%;
}

.message-sent {
    align-self: flex-end;
    justify-content: flex-end;
}

.message-received {
    align-self: flex-start;
    justify-content: flex-start;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 100%;
}

.message-bubble-sent {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-bubble-received {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--ac);
    margin-bottom: 4px;
}

.message-text {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

/* Инпут сообщения */
.message-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--bd);
    background: var(--bg2);
    position: relative;
}

.message-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.sticker-btn, .attach-btn {
    background: var(--bg3);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--t1);
}

.message-input {
    flex: 1;
    background: var(--bg3);
    border: none;
    border-radius: 20px;
    padding: 12px 16px;
    color: var(--t1);
    font-size: 14px;
    resize: none;
    font-family: inherit;
    max-height: 100px;
}

.send-btn {
    background: var(--ac);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #fff;
}

.image-preview {
    margin-top: 8px;
}

.image-preview-item {
    position: relative;
    display: inline-block;
}

.image-preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.image-preview-item .remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--lk);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

/* Стикеры */
.stickers-panel {
    position: absolute;
    bottom: 70px;
    left: 20px;
    right: 20px;
    background: var(--bg2);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    flex-direction: column;
    border: 1px solid var(--bd);
}

.stickers-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--bd);
}

.stickers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 12px;
}

.sticker-item {
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
    text-align: center;
    border-radius: 12px;
}

.sticker-item:hover {
    background: var(--bg3);
}

/* Пустое состояние */
.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--tm);
}

.chat-placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* Адаптация */
@media (max-width: 768px) {
    .chats-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .chats-sidebar.active {
        transform: translateX(0);
    }
    
    .chat-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .message {
        max-width: 85%;
    }
    
    .stickers-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
/* Кастомный скролл для чата */
.custom-scroll {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ac) var(--bg3);
}

.custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: var(--bg3);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: var(--ac);
    border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--ac2);
}

/* Выделенные сообщения для пересылки */
.messenger-message.selected .messenger-message-bubble {
    background: var(--ac);
    border: 2px solid var(--ac2);
    transform: scale(1.01);
}

.messenger-message.selected {
    opacity: 0.9;
}

/* Панель пересылки */
.forward-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--ac);
    color: #fff;
    cursor: pointer;
}

.forward-bar span {
    font-size: 14px;
    font-weight: 500;
}

.forward-cancel {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    cursor: pointer;
}

/* Индикатор ответа на сообщение */
.reply-indicator {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
}

.reply-indicator-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.reply-indicator-sender {
    color: var(--ac);
    font-weight: 600;
}

.reply-indicator-text {
    color: var(--t2);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-indicator-cancel {
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
}

/* Ответ на сообщение в пузырьке */
.message-reply {
    background: rgba(255,255,255,0.1);
    border-left: 3px solid var(--ac);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 12px;
}

.message-reply-sender {
    color: var(--ac);
    font-weight: 600;
    margin-bottom: 2px;
}

.message-reply-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Пересланное сообщение */
.message-forward {
    font-size: 11px;
    color: var(--tm);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Секции чатов */
.chats-section {
    margin-bottom: 16px;
}

.chats-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tm);
    padding: 8px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Кнопка закрепления чата */
.pin-chat-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.pin-chat-btn:hover {
    opacity: 1;
}

/* Бейдж типа чата */
.chat-type-badge {
    font-size: 12px;
    margin-left: 4px;
    opacity: 0.7;
}

/* Действия с чатом */
.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-info-btn {
    background: var(--bg3);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

/* Создание группы */
.new-chat-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selected-users {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.selected-user {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--ac);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
}

.selected-user .remove-user {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

/* Информация о группе */
.group-info {
    text-align: center;
}

.group-avatar-large {
    width: 80px;
    height: 80px;
    background: var(--bg3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 16px;
}

.group-members-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 16px;
}

.group-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
}

.group-member:hover {
    background: var(--bg3);
}

.group-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.group-member-info {
    flex: 1;
}

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

.group-member-role {
    font-size: 11px;
    color: var(--tm);
}

/* Пересылка в чат */
.forward-chats-list {
    max-height: 400px;
    overflow-y: auto;
}

.forward-chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
}

.forward-chat-item:hover {
    background: var(--bg3);
}

.forward-chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.forward-chat-name {
    font-weight: 600;
}

/* Пустое состояние сообщений */
.empty-chat-messages {
    text-align: center;
    padding: 40px;
    color: var(--tm);
}

/* Фикс левой линии */
.messenger-layout {
    display: flex;
    height: calc(100vh - 80px);
    background: var(--bg2);
    border-radius: 20px;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.messenger-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--bd);
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    height: 100%;
}

.messenger-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg1);
    min-width: 0;
    height: 100%;
}
/* Новое меню выбора чата */
.new-chat-modal .modal-body {
    padding: 8px;
}

.new-chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-chat-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg3);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    width: 100%;
}

.new-chat-option:hover {
    background: var(--ac);
    transform: translateX(4px);
}

.new-chat-option-icon {
    width: 48px;
    height: 48px;
    background: var(--bg2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.new-chat-option-info {
    flex: 1;
}

.new-chat-option-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--t1);
    margin-bottom: 4px;
}

.new-chat-option-desc {
    font-size: 12px;
    color: var(--tm);
}

.new-chat-option-arrow {
    font-size: 20px;
    color: var(--tm);
}

/* Стили для выбора участников */
.selected-users-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    min-height: 60px;
}

.selected-users-placeholder {
    font-size: 13px;
    color: var(--tm);
    padding: 12px;
    text-align: center;
    width: 100%;
}

.selected-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ac);
    color: #fff;
    padding: 6px 12px 6px 6px;
    border-radius: 30px;
    font-size: 13px;
}

.selected-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
}

.selected-user-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-user-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

/* Результаты поиска */
.search-results-list {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.search-result-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
}

.search-result-info {
    flex: 1;
}

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

.search-result-handle {
    font-size: 12px;
    color: var(--tm);
}

.add-user-btn, .start-chat-btn {
    background: var(--ac);
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

.empty-results, .error-results {
    text-align: center;
    padding: 40px;
    color: var(--tm);
}

/* Информация о группе */
.group-info-container {
    text-align: center;
}

.group-avatar-large {
    width: 80px;
    height: 80px;
    background: var(--bg3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 16px;
}

.group-name {
    font-size: 20px;
    margin-bottom: 8px;
}

.group-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 16px 0;
    padding: 12px;
    background: var(--bg3);
    border-radius: 16px;
}

.group-stat-value {
    font-weight: 700;
    font-size: 20px;
}

.group-stat-label {
    font-size: 12px;
    color: var(--tm);
}

.group-members-title {
    font-weight: 600;
    margin: 16px 0 8px;
    text-align: left;
}

.group-members-list {
    max-height: 300px;
    overflow-y: auto;
}

.group-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}

.group-member-item:hover {
    background: var(--bg3);
}

.group-member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
}

.group-member-info {
    flex: 1;
}

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

.group-member-role {
    font-size: 11px;
    color: var(--tm);
}
/* Кнопки действий над сообщениями */
.messenger-message-actions {
    position: absolute;
    right: 8px;
    top: -20px;
    display: flex;
    gap: 4px;
    background: var(--bg2);
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.messenger-message:hover .messenger-message-actions {
    opacity: 1;
}

.message-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: var(--bg3);
    color: var(--ac);
}

/* Блок ответа на сообщение */
.message-reply {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--ac);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    font-size: 12px;
}

.message-reply-sender {
    color: var(--ac);
    font-weight: 600;
    margin-bottom: 2px;
}

.message-reply-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Блок пересылки */
.message-forward {
    font-size: 11px;
    color: var(--tm);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Индикатор ответа в поле ввода */
.reply-indicator {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reply-indicator-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 12px;
}

.reply-indicator-sender {
    color: var(--ac);
    font-weight: 600;
}

.reply-indicator-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-indicator-cancel {
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
}

.reply-indicator-cancel:hover {
    color: var(--lk);
}

/* Панель пересылки */
.forward-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--ac);
    color: #fff;
    cursor: pointer;
    border-radius: 12px;
    margin-bottom: 8px;
}

.forward-bar span {
    font-size: 14px;
    font-weight: 500;
}

.forward-cancel {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}

.forward-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Выделенные сообщения */
.messenger-message.selected .messenger-message-bubble {
    background: var(--ac);
    border: 2px solid var(--ac2);
    transform: scale(1.01);
}

.messenger-message-out.selected .messenger-message-bubble {
    background: var(--ac2);
}

/* Системные сообщения */
.messenger-system-message {
    text-align: center;
    padding: 6px 12px;
    margin: 8px auto;
    background: var(--bg3);
    border-radius: 20px;
    font-size: 11px;
    color: var(--tm);
    width: fit-content;
    max-width: 80%;
}

/* Метка "изменено" */
.message-edited {
    font-size: 10px;
    color: var(--tm);
    margin-left: 6px;
    font-weight: normal;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .messenger-message-actions {
        position: static;
        opacity: 1;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 4px;
        justify-content: flex-end;
    }
    
    .message-action-btn {
        padding: 4px;
    }
    
    .reply-indicator {
        padding: 8px 10px;
    }
    
    .reply-indicator-content {
        font-size: 11px;
    }
    
    .forward-bar {
        padding: 10px 14px;
    }
}
/* ========== СООБЩЕНИЯ В МЕССЕНДЖЕРЕ ========== */
.messenger-message {
    position: relative;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.messenger-message-out {
    align-items: flex-end;
}

.messenger-message-in {
    align-items: flex-start;
}

.messenger-message-content {
    max-width: 70%;
    position: relative;
}

/* Блок с действиями над сообщением (при наведении) */
.messenger-message-actions {
    position: absolute;
    top: -28px;
    right: 0;
    display: flex;
    gap: 4px;
    background: var(--bg2);
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    border: 1px solid var(--bd);
}

.messenger-message-in .messenger-message-actions {
    right: auto;
    left: 0;
}

.messenger-message:hover .messenger-message-actions {
    opacity: 1;
    visibility: visible;
}

/* Кнопки действий */
.message-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: var(--bg3);
    color: var(--ac);
    cursor: pointer;
}

/* Пузырь сообщения */
.messenger-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    max-width: 100%;
    background: var(--bg3);
}

.messenger-message-out .messenger-message-bubble {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.messenger-message-in .messenger-message-bubble {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

/* Текст сообщения */
.messenger-message-text {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

/* Имя отправителя */
.messenger-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--ac);
    margin-bottom: 4px;
    padding-left: 4px;
}

/* Время сообщения */
.messenger-message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

/* Блок ответа на сообщение */
.message-reply {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--ac);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}

.messenger-message-out .message-reply {
    background: rgba(255, 255, 255, 0.15);
}

.message-reply-sender {
    color: var(--ac);
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 11px;
}

.message-reply-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

.messenger-message-out .message-reply-text {
    color: rgba(255, 255, 255, 0.8);
}

/* Блок пересылки */
.message-forward {
    font-size: 11px;
    color: var(--tm);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.messenger-message-out .message-forward {
    color: rgba(255, 255, 255, 0.7);
}

.message-forward:hover {
    text-decoration: underline;
}

/* Метка "изменено" */
.message-edited {
    font-size: 10px;
    color: var(--tm);
    margin-left: 6px;
    font-weight: normal;
}

.messenger-message-out .message-edited {
    color: rgba(255, 255, 255, 0.6);
}

/* Фото в сообщении */
.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Индикатор ответа в поле ввода */
.reply-indicator {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reply-indicator-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 12px;
}

.reply-indicator-sender {
    color: var(--ac);
    font-weight: 600;
}

.reply-indicator-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-indicator-cancel {
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    transition: color 0.2s;
}

.reply-indicator-cancel:hover {
    color: var(--lk);
    cursor: pointer;
}

/* Панель пересылки */
.forward-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--ac);
    color: #fff;
    cursor: pointer;
    border-radius: 12px;
    margin-bottom: 8px;
}

.forward-bar span {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.forward-cancel {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.forward-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

/* Выделенные сообщения для пересылки */
.messenger-message.selected .messenger-message-bubble {
    background: var(--ac);
    border: 2px solid var(--ac2);
    transform: scale(1.01);
}

.messenger-message-out.selected .messenger-message-bubble {
    background: var(--ac2);
}

/* Системные сообщения */
.messenger-system-message {
    text-align: center;
    padding: 6px 12px;
    margin: 8px auto;
    background: var(--bg3);
    border-radius: 20px;
    font-size: 11px;
    color: var(--tm);
    width: fit-content;
    max-width: 80%;
}

/* Индикатор печати */
.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-text {
    font-size: 12px;
    color: var(--ac);
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background-color: var(--ac);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-3px); opacity: 1; }
}

/* Статус в хедере чата */
.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

/* Кнопки в хедере */
.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.messenger-back-btn,
.chat-info-btn,
.leave-group-btn {
    background: var(--bg3);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--t1);
}

.messenger-back-btn:hover,
.chat-info-btn:hover,
.leave-group-btn:hover {
    background: var(--bd);
    cursor: pointer;
    transform: scale(1.02);
}

.leave-group-btn {
    color: var(--lk);
}

.leave-group-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .messenger-message-content {
        max-width: 85%;
    }
    
    .messenger-message-actions {
        position: static;
        opacity: 1;
        visibility: visible;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 4px;
        justify-content: flex-end;
    }
    
    .message-action-btn {
        padding: 4px;
    }
    
    .reply-indicator {
        padding: 8px 10px;
    }
    
    .reply-indicator-content {
        font-size: 11px;
    }
    
    .forward-bar {
        padding: 10px 14px;
    }
}
/* ========== СООБЩЕНИЯ В МЕССЕНДЖЕРЕ ========== */
.messenger-message {
    position: relative;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.messenger-message-out {
    align-items: flex-end;
}

.messenger-message-in {
    align-items: flex-start;
}

.messenger-message-content {
    max-width: 70%;
    min-width: 90px;
    position: relative;
}

/* Блок с действиями над сообщением (при наведении) */
.messenger-message-actions {
    position: absolute;
    top: -28px;
    right: 0;
    display: flex;
    gap: 4px;
    background: var(--bg2);
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    border: 1px solid var(--bd);
}

.messenger-message-in .messenger-message-actions {
    right: auto;
    left: 0;
}

.messenger-message:hover .messenger-message-actions {
    opacity: 1;
    visibility: visible;
}

/* Кнопки действий */
.message-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: var(--bg3);
    color: var(--ac);
    cursor: pointer;
}

/* Пузырь сообщения - с минимальной шириной */
.messenger-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    min-width: 60px;
    width: auto;
    display: inline-block;
}

.messenger-message-out .messenger-message-bubble {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.messenger-message-in .messenger-message-bubble {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

/* Обертка для содержимого пузырька */
.messenger-message-bubble > * {
    width: 100%;
}

/* Текст сообщения */
.messenger-message-text {
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    display: inline-block;
    width: 100%;
}

/* Имя отправителя */
.messenger-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--ac);
    margin-bottom: 4px;
    padding-left: 4px;
}

/* Время сообщения */
.messenger-message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
    white-space: nowrap;
}

/* Блок ответа на сообщение */
.message-reply {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--ac);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    min-width: 120px;
}

.messenger-message-out .message-reply {
    background: rgba(255, 255, 255, 0.15);
}

.message-reply-sender {
    color: var(--ac);
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 10px;
}

.message-reply-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
}

.messenger-message-out .message-reply-text {
    color: rgba(255, 255, 255, 0.8);
}

/* Блок пересылки */
.message-forward {
    font-size: 10px;
    color: var(--tm);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.messenger-message-out .message-forward {
    color: rgba(255, 255, 255, 0.7);
}

.message-forward:hover {
    text-decoration: underline;
}

/* Метка "изменено" */
.message-edited {
    font-size: 9px;
    color: var(--tm);
    margin-left: 4px;
    font-weight: normal;
}

.messenger-message-out .message-edited {
    color: rgba(255, 255, 255, 0.6);
}

/* Фото в сообщении */
.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    margin-top: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Индикатор ответа в поле ввода */
.reply-indicator {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reply-indicator-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 12px;
}

.reply-indicator-sender {
    color: var(--ac);
    font-weight: 600;
}

.reply-indicator-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-indicator-cancel {
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    transition: color 0.2s;
}

.reply-indicator-cancel:hover {
    color: var(--lk);
    cursor: pointer;
}

/* Панель пересылки */
.forward-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--ac);
    color: #fff;
    cursor: pointer;
    border-radius: 10px;
    margin-bottom: 8px;
}

.forward-bar span {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.forward-cancel {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.forward-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

/* Выделенные сообщения для пересылки */
.messenger-message.selected .messenger-message-bubble {
    background: var(--ac);
    border: 2px solid var(--ac2);
    transform: scale(1.01);
}

.messenger-message-out.selected .messenger-message-bubble {
    background: var(--ac2);
}

/* Системные сообщения */
.messenger-system-message {
    text-align: center;
    padding: 5px 10px;
    margin: 6px auto;
    background: var(--bg3);
    border-radius: 16px;
    font-size: 11px;
    color: var(--tm);
    width: fit-content;
    max-width: 80%;
}

/* Индикатор печати */
.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-text {
    font-size: 12px;
    color: var(--ac);
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 2px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background-color: var(--ac);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-2px); opacity: 1; }
}

/* Статус в хедере чата */
.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

/* Кнопки в хедере */
.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.messenger-back-btn,
.chat-info-btn,
.leave-group-btn {
    background: var(--bg3);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--t1);
}

.messenger-back-btn:hover,
.chat-info-btn:hover,
.leave-group-btn:hover {
    background: var(--bd);
    cursor: pointer;
    transform: scale(1.02);
}

.leave-group-btn {
    color: var(--lk);
}

.leave-group-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .messenger-message-content {
        max-width: 85%;
        min-width: 70px;
    }
    
    .messenger-message-bubble {
        min-width: 50px;
    }
    
    .messenger-message-actions {
        position: static;
        opacity: 1;
        visibility: visible;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 4px;
        justify-content: flex-end;
    }
    
    .message-action-btn {
        padding: 4px;
    }
    
    .reply-indicator {
        padding: 6px 10px;
    }
    
    .reply-indicator-content {
        font-size: 11px;
    }
    
    .forward-bar {
        padding: 8px 12px;
    }
    
    .message-reply {
        min-width: 100px;
    }
}
/* ========== СООБЩЕНИЯ В МЕССЕНДЖЕРЕ ========== */
.messenger-message {
    position: relative;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.messenger-message-out {
    align-items: flex-end;
}

.messenger-message-in {
    align-items: flex-start;
}

.messenger-message-content {
    max-width: 75%;
    min-width: 80px;
    position: relative;
}

/* Аватар в сообщении (только для входящих) */
.messenger-message-avatar {
    position: absolute;
    left: -40px;
    bottom: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.messenger-message-avatar img,
.messenger-message-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

/* Блок с действиями над сообщением */
.messenger-message-actions {
    position: absolute;
    top: -30px;
    right: 0;
    display: flex;
    gap: 4px;
    background: var(--bg2);
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    border: 1px solid var(--bd);
}

.messenger-message-in .messenger-message-actions {
    right: auto;
    left: 0;
}

.messenger-message:hover .messenger-message-actions {
    opacity: 1;
    visibility: visible;
}

/* Кнопки действий */
.message-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: var(--bg3);
    color: var(--ac);
    cursor: pointer;
}

/* Имя отправителя */
.messenger-message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--ac);
    margin-bottom: 4px;
    padding-left: 4px;
}

/* Пузырь сообщения */
.messenger-message-bubble {
    padding: 8px 12px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: inline-block;
    max-width: 100%;
}

.messenger-message-out .messenger-message-bubble {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.messenger-message-in .messenger-message-bubble {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

/* Текст сообщения с переносом строк */
.messenger-message-text {
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Время сообщения */
.messenger-message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
    white-space: nowrap;
}

/* Блок ответа на сообщение */
.message-reply {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--ac);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 12px;
    cursor: pointer;
}

.messenger-message-out .message-reply {
    background: rgba(255, 255, 255, 0.12);
}

.message-reply-sender {
    color: var(--ac);
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 10px;
}

.message-reply-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    max-width: 250px;
}

.messenger-message-out .message-reply-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Блок пересылки */
.message-forward {
    font-size: 10px;
    color: var(--tm);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.messenger-message-out .message-forward {
    color: rgba(255, 255, 255, 0.6);
}

.message-forward:hover {
    text-decoration: underline;
}

/* Метка "изменено" */
.message-edited {
    font-size: 9px;
    color: var(--tm);
    margin-left: 4px;
    font-weight: normal;
}

.messenger-message-out .message-edited {
    color: rgba(255, 255, 255, 0.5);
}

/* Фото в сообщении */
.message-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 12px;
    margin-top: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Индикатор ответа в поле ввода */
.reply-indicator {
    background: var(--bg3);
    border-left: 3px solid var(--ac);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reply-indicator-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 12px;
    overflow: hidden;
}

.reply-indicator-sender {
    color: var(--ac);
    font-weight: 600;
    flex-shrink: 0;
}

.reply-indicator-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.reply-indicator-cancel {
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    transition: color 0.2s;
    flex-shrink: 0;
}

.reply-indicator-cancel:hover {
    color: var(--lk);
    cursor: pointer;
}

/* Панель пересылки */
.forward-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--ac);
    color: #fff;
    cursor: pointer;
    border-radius: 10px;
    margin-bottom: 8px;
}

.forward-bar span {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.forward-cancel {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.forward-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

/* Выделенные сообщения для пересылки */
.messenger-message.selected .messenger-message-bubble {
    background: var(--ac);
    border: 2px solid var(--ac2);
    transform: scale(1.01);
}

.messenger-message-out.selected .messenger-message-bubble {
    background: var(--ac2);
}

/* Системные сообщения */
.messenger-system-message {
    text-align: center;
    padding: 5px 10px;
    margin: 6px auto;
    background: var(--bg3);
    border-radius: 16px;
    font-size: 11px;
    color: var(--tm);
    width: fit-content;
    max-width: 80%;
}

/* Индикатор печати */
.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-text {
    font-size: 12px;
    color: var(--ac);
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background-color: var(--ac);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-3px); opacity: 1; }
}

/* Статус в хедере чата */
.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

/* Кнопки в хедере */
.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.messenger-back-btn,
.chat-info-btn,
.leave-group-btn {
    background: var(--bg3);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--t1);
}

.messenger-back-btn:hover,
.chat-info-btn:hover,
.leave-group-btn:hover {
    background: var(--bd);
    cursor: pointer;
    transform: scale(1.02);
}

.leave-group-btn {
    color: var(--lk);
}

.leave-group-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .messenger-message-content {
        max-width: 85%;
        min-width: 70px;
    }
    
    .messenger-message-avatar {
        width: 28px;
        height: 28px;
        left: -34px;
    }
    
    .messenger-message-bubble {
        padding: 6px 10px;
    }
    
    .messenger-message-text {
        font-size: 13px;
    }
    
    .messenger-message-actions {
        position: static;
        opacity: 1;
        visibility: visible;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 4px;
        justify-content: flex-end;
    }
    
    .message-action-btn {
        padding: 4px;
    }
    
    .reply-indicator {
        padding: 6px 10px;
    }
    
    .reply-indicator-content {
        font-size: 11px;
    }
    
    .forward-bar {
        padding: 8px 12px;
    }
    
    .message-reply-text {
        max-width: 180px;
    }
} 
/* ========== ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ КНОПОК УДАЛЕНИЯ ========== */

/* Кнопка удаления чата в списке */
.delete-chat-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.delete-chat-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--tm) !important;
    fill: none;
    transition: all 0.2s ease;
}

.delete-chat-btn:hover {
    opacity: 1;
    background: var(--bg3) !important;
}

.delete-chat-btn:hover svg {
    stroke: var(--lk) !important;
}

/* Кнопка удаления в шапке чата */
.chat-header-actions .delete-chat-btn {
    background: var(--bg3) !important;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.chat-header-actions .delete-chat-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--t2) !important;
}

.chat-header-actions .delete-chat-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15) !important;
}

.chat-header-actions .delete-chat-btn:hover svg {
    stroke: var(--lk) !important;
}

/* Кнопка закрепления чата */
.pin-chat-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.5;
    font-size: 14px;
}

.pin-chat-btn:hover {
    opacity: 1;
    background: var(--bg3) !important;
}

/* ========== ИНДИКАТОР ПЕЧАТИ ========== */
.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    min-height: 20px;
}

.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-text {
    font-size: 12px;
    color: var(--ac);
    font-weight: 500;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background-color: var(--ac);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ========== СООБЩЕНИЯ - ПРАВИЛЬНЫЕ ГРАНИЦЫ ========== */
.messenger-message-content {
    max-width: 75%;
    min-width: 80px;
    position: relative;
}

.messenger-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.messenger-message-out .messenger-message-bubble {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.messenger-message-in .messenger-message-bubble {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

.messenger-message-text {
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* Блок ответа на сообщение */
.message-reply {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--ac);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 12px;
    cursor: pointer;
    max-width: 100%;
}

.message-reply-sender {
    color: var(--ac);
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 10px;
}

.message-reply-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    max-width: 220px;
}

.messenger-message-out .message-reply-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Блок пересылки */
.message-forward {
    font-size: 10px;
    color: var(--tm);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.messenger-message-out .message-forward {
    color: rgba(255, 255, 255, 0.6);
}

/* Метка "изменено" */
.message-edited {
    font-size: 9px;
    color: var(--tm);
    margin-left: 4px;
    font-weight: normal;
}

.messenger-message-out .message-edited {
    color: rgba(255, 255, 255, 0.5);
}

/* Кнопки действий над сообщением (при наведении) */
.messenger-message-actions {
    position: absolute;
    top: -28px;
    right: 0;
    display: flex;
    gap: 4px;
    background: var(--bg2);
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    border: 1px solid var(--bd);
}

.messenger-message-in .messenger-message-actions {
    right: auto;
    left: 0;
}

.messenger-message:hover .messenger-message-actions {
    opacity: 1;
    visibility: visible;
}

.message-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: var(--bg3);
    color: var(--ac);
}

.message-action-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .messenger-message-content {
        max-width: 85%;
    }
    
    .messenger-message-actions {
        position: static;
        opacity: 1;
        visibility: visible;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 4px;
        justify-content: flex-end;
    }
    
    .message-action-btn {
        padding: 4px;
    }
    
    .message-reply-text {
        max-width: 180px;
    }
}
/* ========== ИСПРАВЛЕННЫЕ СТИЛИ ДЛЯ КНОПОК УДАЛЕНИЯ ========== */

/* Кнопка удаления чата в списке */
.delete-chat-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.delete-chat-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--tm) !important;
    fill: none;
    transition: all 0.2s ease;
}

.delete-chat-btn:hover {
    opacity: 1;
    background: var(--bg3) !important;
}

.delete-chat-btn:hover svg {
    stroke: var(--lk) !important;
}

/* Кнопка удаления в шапке чата */
.chat-header-actions .delete-chat-btn {
    background: var(--bg3) !important;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.chat-header-actions .delete-chat-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--t2) !important;
}

.chat-header-actions .delete-chat-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15) !important;
}

.chat-header-actions .delete-chat-btn:hover svg {
    stroke: var(--lk) !important;
}

/* Кнопка закрепления чата */
.pin-chat-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.5;
    font-size: 14px;
}

.pin-chat-btn:hover {
    opacity: 1;
    background: var(--bg3) !important;
}

/* ========== ИНДИКАТОР ПЕЧАТИ ========== */
.messenger-chat-header-status {
    font-size: 12px;
    color: var(--tm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    min-height: 20px;
}

.typing-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-text {
    font-size: 12px;
    color: var(--ac);
    font-weight: 500;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background-color: var(--ac);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ========== СООБЩЕНИЯ - ПРАВИЛЬНЫЕ ГРАНИЦЫ ========== */
.messenger-message-content {
    max-width: 75%;
    min-width: 80px;
    position: relative;
}

.messenger-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.messenger-message-out .messenger-message-bubble {
    background: var(--ac);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.messenger-message-in .messenger-message-bubble {
    background: var(--bg3);
    color: var(--t1);
    border-bottom-left-radius: 4px;
}

.messenger-message-text {
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* Блок ответа на сообщение */
.message-reply {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--ac);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 12px;
    cursor: pointer;
    max-width: 100%;
}

.message-reply-sender {
    color: var(--ac);
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 10px;
}

.message-reply-text {
    color: var(--t2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    max-width: 220px;
}

.messenger-message-out .message-reply-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Блок пересылки */
.message-forward {
    font-size: 10px;
    color: var(--tm);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.messenger-message-out .message-forward {
    color: rgba(255, 255, 255, 0.6);
}

/* Метка "изменено" */
.message-edited {
    font-size: 9px;
    color: var(--tm);
    margin-left: 4px;
    font-weight: normal;
}

.messenger-message-out .message-edited {
    color: rgba(255, 255, 255, 0.5);
}

/* Кнопки действий над сообщением (при наведении) */
.messenger-message-actions {
    position: absolute;
    top: -28px;
    right: 0;
    display: flex;
    gap: 4px;
    background: var(--bg2);
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
    border: 1px solid var(--bd);
}

.messenger-message-in .messenger-message-actions {
    right: auto;
    left: 0;
}

.messenger-message:hover .messenger-message-actions {
    opacity: 1;
    visibility: visible;
}

.message-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);
    transition: all 0.2s;
}

.message-action-btn:hover {
    background: var(--bg3);
    color: var(--ac);
}

.message-action-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .messenger-message-content {
        max-width: 85%;
    }
    
    .messenger-message-actions {
        position: static;
        opacity: 1;
        visibility: visible;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-bottom: 4px;
        justify-content: flex-end;
    }
    
    .message-action-btn {
        padding: 4px;
    }
    
    .message-reply-text {
        max-width: 180px;
    }
}
/* ========== ГРУППЫ - ИСПРАВЛЕННЫЕ СТИЛИ ========== */

/* Хедер группы */
.group-header {
    background: var(--bg2);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
}

.group-cover {
    height: 180px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.change-group-cover-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.change-group-cover-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.group-info {
    padding: 20px;
}

.group-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.group-icon {
    width: 70px;
    height: 70px;
    background: var(--bg3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.group-details {
    flex: 1;
}

.group-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.group-meta {
    font-size: 13px;
    color: var(--tm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-desc {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    color: var(--t2);
}

.group-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bd);
}

.group-stat {
    text-align: center;
}

.group-stat-value {
    font-weight: 700;
    font-size: 20px;
}

.group-stat-label {
    font-size: 12px;
    color: var(--tm);
}

.group-actions {
    display: flex;
    gap: 12px;
}

/* Участники группы */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg2);
    border-radius: 14px;
    transition: all 0.2s;
    position: relative;
}

.member-card:hover {
    background: var(--bg3);
    transform: translateX(4px);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.member-avatar img,
.member-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.member-info {
    flex: 1;
    cursor: pointer;
}

.member-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.member-handle {
    font-size: 12px;
    color: var(--tm);
}

.role-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: var(--bg3);
    border-radius: 12px;
    margin-top: 4px;
    color: var(--ac);
}

.message-member-btn {
    background: var(--bg3);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--tm);
    flex-shrink: 0;
}

.message-member-btn:hover {
    background: var(--ac);
    color: #fff;
    transform: scale(1.05);
}

/* Кнопка назад */
.back-btn {
    background: var(--bg3);
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--t1);
    margin-bottom: 20px;
    transition: all 0.2s;
    font-size: 14px;
}

.back-btn:hover {
    background: var(--bd);
}

/* Табы */
.group-tabs {
    display: flex;
    gap: 0;
    background: var(--bg2);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 16px;
}

.group-tabs .tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--t2);
    transition: all 0.2s;
}

.group-tabs .tab:hover {
    color: var(--t1);
    background: var(--bg3);
}

.group-tabs .tab.active {
    background: var(--bg3);
    color: var(--t1);
}

/* Посты в группе */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-card {
    background: var(--bg2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
}

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

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.post-avatar img,
.post-avatar span {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.post-user-info {
    flex: 1;
    cursor: pointer;
}

.post-username {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.post-handle {
    font-size: 12px;
    color: var(--tm);
}

.post-content {
    padding: 0 16px 14px;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--bd);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--tm);
    cursor: pointer;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 20px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg3);
    color: var(--t1);
}

.action-btn.liked {
    color: var(--lk);
}

/* Пустые состояния */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--tm);
}

.empty-state h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--t1);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .group-top {
        flex-direction: column;
        text-align: center;
    }
    
    .group-icon {
        margin: 0 auto;
    }
    
    .group-stats {
        justify-content: center;
    }
    
    .group-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
    
    .post-header {
        flex-wrap: wrap;
    }
    
    .post-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}
/*sss*/
/* Вкладки ленты */
.feed-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--surface-color);
    border-radius: 12px;
    padding: 4px;
}

.feed-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.feed-tab.active {
    background: var(--primary-color);
    color: white;
}

/* Панель поиска */
.search-panel {
    background: var(--surface-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 16px;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.search-btn:hover {
    opacity: 0.9;
}

.search-filters {
    display: flex;
    gap: 8px;
}

.search-filter {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.search-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.search-section-title {
    margin: 20px 0 15px;
    font-size: 18px;
    color: var(--text-primary);
}

.users-grid {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

/* Просмотры */
.views-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
}
/* Тулбар */
.feed-toolbar {
    display: flex;
    gap: 8px;
    background: var(--surface-color);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.toolbar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn svg {
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

.toolbar-btn.active svg {
    stroke: white;
}

/* Поиск */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
}

.search-input {
    flex: 1;
    padding: 12px 16px 12px 40px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 15px;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.search-btn:hover {
    opacity: 0.9;
}

.search-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.search-filter {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-filter:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.search-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.search-section-title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Просмотры */
.views-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

.spacer {
    flex: 1;
}
/* Тулбар */
.feed-toolbar {
    display: flex;
    gap: 8px;
    background: var(--surface-color);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.toolbar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn svg {
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

.toolbar-btn.active svg {
    stroke: white;
}

/* Поиск - красивая карточка */
.search-panel {
    margin-bottom: 20px;
}

.search-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.search-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.search-submit-btn svg {
    stroke: white;
}

.search-filters {
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.search-filter {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.search-filter:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.search-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Пост-действия */
.post-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--hover-color);
}

.action-btn.liked {
    color: #e74c3c;
}

.action-btn.liked svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 6px 12px;
    background: var(--background-color);
    border-radius: 20px;
}

.spacer {
    flex: 1;
}

/* Поиск результатов */
.search-section-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.users-grid {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.member-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    cursor: pointer;
}

.member-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.member-handle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.member-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.message-member-btn {
    padding: 8px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.message-member-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
/* Image Viewer Modal */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-viewer.open {
    opacity: 1;
}

.image-viewer.closing {
    opacity: 0;
}

.image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
}

.image-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.image-viewer-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: zoomIn 0.3s ease;
}

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

.image-viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.image-viewer-prev,
.image-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.image-viewer-prev {
    left: 20px;
}

.image-viewer-next {
    right: 20px;
}

.image-viewer-prev:hover,
.image-viewer-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.image-viewer-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    z-index: 2;
}

.image-counter {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.image-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.image-download-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Анимация для просмотров */
.post-views .views-count {
    transition: transform 0.2s ease;
    display: inline-block;
}

/* Пост с изображением - курсор pointer */
.post-image {
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.post-image:hover {
    opacity: 0.95;
    transform: scale(0.99);
}
/* Хэштеги */
.hashtag {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.hashtag:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Ссылки в постах */
.post-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
    transition: all 0.2s;
}

.post-link:hover {
    border-bottom-style: solid;
}

/* Кнопка "Показать полностью" */
.expand-post-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.expand-post-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Превью ссылок */
.link-preview {
    display: flex;
    gap: 12px;
    margin: 12px 0;
    padding: 12px;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.link-preview:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
}

.link-preview-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    min-width: 0;
}

.link-preview-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Контейнер поста */
.post-content-container {
    margin-bottom: 8px;
}

.post-content {
    line-height: 1.5;
    word-wrap: break-word;
}

/* Адаптив для превью ссылок */
@media (max-width: 600px) {
    .link-preview-image {
        width: 60px;
        height: 60px;
    }
    
    .link-preview-title {
        font-size: 12px;
    }
}
/* Пост карточка */
.post-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    position: relative;
}

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

/* Заголовок поста */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.post-user-info {
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.post-username {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.post-handle {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
    flex-shrink: 0;
}

/* Контент поста */
.post-content-container {
    margin-bottom: 12px;
}

.post-content {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
    white-space: normal;
    text-align: left;
}

/* Хэштеги */
.hashtag {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.hashtag:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Ссылки в постах */
.post-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
    transition: all 0.2s;
    word-break: break-all;
}

.post-link:hover {
    border-bottom-style: solid;
}

/* Кнопка "Показать полностью" */
.expand-post-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
    font-weight: 500;
    transition: opacity 0.2s;
    display: inline-block;
}

.expand-post-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Изображение поста */
.post-image {
    margin: 12px 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.post-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.post-image:hover {
    opacity: 0.95;
    transform: scale(0.99);
}

/* Превью ссылок */
.link-preview-container {
    margin: 12px 0;
}

.link-preview {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.link-preview:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
}

.link-preview-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.link-preview-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.link-preview-url {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Действия поста */
.post-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--hover-color);
}

.action-btn.liked {
    color: #e74c3c;
}

.action-btn.liked svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 6px 12px;
    background: var(--background-color);
    border-radius: 20px;
}

/* Комментарии */
.comments-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.comment-body {
    flex: 1;
    background: var(--background-color);
    padding: 8px 12px;
    border-radius: 12px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    cursor: pointer;
    color: var(--text-primary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
}

.comment-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.delete-comment-btn {
    position: absolute;
    right: 0;
    top: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}

/* Адаптив */
@media (max-width: 600px) {
    .post-card {
        padding: 12px;
    }
    
    .link-preview-image {
        width: 60px;
        height: 60px;
    }
    
    .post-actions {
        gap: 12px;
    }
    
    .action-btn {
        padding: 4px 8px;
    }
}
/* Пост карточка - с фоном и тенью */
.post-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Заголовок поста */
.post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    background: var(--background-color);
}

.post-avatar img,
.post-avatar span {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-user-info {
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.post-username {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.post-handle {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Контент поста */
.post-content-container {
    margin-bottom: 16px;
}

.post-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    word-break: break-word;
    white-space: normal;
    text-align: left;
}

/* Хэштеги */
.hashtag {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.hashtag:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Ссылки в постах */
.post-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
    transition: all 0.2s;
    word-break: break-all;
}

.post-link:hover {
    border-bottom-style: solid;
}

/* Кнопка "Показать полностью" */
.expand-post-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 0 0 0;
    margin-top: 8px;
    font-weight: 500;
    transition: opacity 0.2s;
    display: inline-block;
}

.expand-post-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Изображение поста */
.post-image {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--background-color);
}

.post-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.post-image:hover {
    transform: scale(0.99);
}

.post-image:hover img {
    transform: scale(1.02);
}

/* Превью ссылок */
.link-preview-container {
    margin: 16px 0;
}

.link-preview {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.link-preview:hover {
    background: var(--hover-color);
    transform: translateY(-1px);
    border-color: var(--primary-color);
}

.link-preview-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-color);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.link-preview-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.link-preview-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Действия поста */
.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--hover-color);
    transform: scale(1.02);
}

.action-btn.liked {
    color: #e74c3c;
}

.action-btn.liked svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.post-views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 8px 16px;
    background: var(--background-color);
    border-radius: 30px;
}

.post-views svg {
    stroke: var(--text-secondary);
}

/* Комментарии */
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--background-color);
}

.comment-body {
    flex: 1;
    background: var(--background-color);
    padding: 10px 14px;
    border-radius: 16px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    cursor: pointer;
    color: var(--text-primary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.comment-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.delete-comment-btn {
    position: absolute;
    right: 0;
    top: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}

.delete-comment-btn:hover {
    background: var(--hover-color);
    color: #e74c3c;
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}

/* Комментарий инпут */
.comment-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 13px;
    color: var(--text-primary);
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-image-btn,
.comment-send {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-image-btn:hover,
.comment-send:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.comment-image-btn:hover svg,
.comment-send:hover svg {
    stroke: white;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.3s ease;
}

/* Адаптив */
@media (max-width: 600px) {
    .post-card {
        padding: 14px;
        margin-bottom: 14px;
    }
    
    .post-avatar {
        width: 40px;
        height: 40px;
    }
    
    .post-username {
        font-size: 14px;
    }
    
    .link-preview-image {
        width: 60px;
        height: 60px;
    }
    
    .post-actions {
        gap: 8px;
    }
    
    .action-btn,
    .post-views {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .action-btn svg,
    .post-views svg {
        width: 16px;
        height: 16px;
    }
/* Глобальные переменные - светлая тема */
:root {
    --surface-card: #ffffff;
    --surface-hover: #f8f9fa;
    --background-page: #f0f2f5;
    --border-light: #e4e6eb;
    --text-primary: #1a1a1a;
    --text-secondary: #65676b;
    --primary-color: #1877f2;
    --primary-hover: #166fe5;
    --danger-color: #e41e3f;
    --success-color: #31a24c;
}

[data-theme="dark"] {
    --surface-card: #242526;
    --surface-hover: #3a3b3c;
    --background-page: #18191a;
    --border-light: #3e4042;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --primary-color: #2374e1;
    --primary-hover: #1b66c9;
}

/* Страница */
body {
    background: var(--background-page);
}

/* Пост карточка - светлая, с тенью, не сливается */
.post-card {
    background: var(--surface-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Заголовок */
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border-light);
}

.post-user-info {
    flex: 1;
    cursor: pointer;
}

.post-username {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-handle {
    font-size: 12px;
    color: var(--text-secondary);
}

.post-time {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Контент */
.post-content-container {
    margin-bottom: 12px;
}

.post-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
}

/* Изображение */
.post-image {
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--border-light);
}

.post-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

/* Статистика (лайки, комментарии, просмотры) */
.post-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-item svg {
    stroke: var(--text-secondary);
}

.views-count {
    margin-left: auto;
}

/* Кнопки действий */
.post-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--surface-hover);
}

.action-btn.liked {
    color: var(--primary-color);
}

/* Хэштеги */
.hashtag {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.hashtag:hover {
    text-decoration: underline;
}

/* Ссылки */
.post-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
}

.post-link:hover {
    border-bottom-style: solid;
}

/* Превью ссылок */
.link-preview-container {
    margin: 12px 0;
}

.link-preview {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--surface-hover);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s;
}

.link-preview:hover {
    background: var(--surface-card);
    border-color: var(--primary-color);
}

.link-preview-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border-light);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    min-width: 0;
}

.link-preview-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка "Показать полностью" */
.expand-post-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
}

.expand-post-btn:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Комментарии */
.comments-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* Адаптив */
@media (max-width: 600px) {
    .post-card {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    .post-avatar {
        width: 36px;
        height: 36px;
    }
    
    .post-username {
        font-size: 14px;
    }
    
    .action-btn {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .link-preview-image {
        width: 55px;
        height: 55px;
    }
/* Глобальные переменные - светлая тема */
:root {
    --surface-card: #ffffff;
    --surface-hover: #f8f9fa;
    --background-page: #eef2f5;
    --border-light: #e9ecef;
    --border-card: #dee2e6;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --surface-card: #2d2d2f;
    --surface-hover: #3a3a3c;
    --background-page: #1c1c1e;
    --border-light: #3a3a3c;
    --border-card: #48484a;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --primary-color: #0a84ff;
    --primary-hover: #409cff;
}

/* Страница */
body, #main-content {
    background: var(--background-page);
}

/* Пост карточка - очень светлая, с четкой границей */
.post-card {
    background: var(--surface-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    position: relative;
}

.post-card:last-child {
    margin-bottom: 0;
}

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

/* Заголовок поста */
.post-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border-light);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.post-avatar img,
.post-avatar span {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-user-info {
    flex: 1;
    cursor: pointer;
}

.post-username {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

.post-handle {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
    padding: 4px 8px;
    background: var(--surface-hover);
    border-radius: 20px;
}

/* Контент поста */
.post-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 16px;
    padding: 4px 0;
}

/* Изображение поста */
.post-image {
    margin: 12px 0 16px 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: var(--border-light);
    max-height: 500px;
}

.post-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.post-image:hover img {
    transform: scale(1.02);
}

/* Действия поста */
.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0 4px 0;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 30px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.action-btn.liked {
    color: var(--primary-color);
}

.action-btn.liked svg {
    fill: var(--primary-color);
    stroke: var(--primary-color);
}

.spacer {
    flex: 1;
}

.views-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--surface-hover);
    border-radius: 30px;
}

/* Хэштеги */
.hashtag {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.hashtag:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Ссылки */
.post-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(13, 110, 253, 0.3);
    transition: all 0.2s;
    word-break: break-all;
}

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

/* Превью ссылок */
.link-preview-container {
    margin: 16px 0;
}

.link-preview {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--surface-hover);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.link-preview:hover {
    background: var(--surface-card);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.link-preview-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--border-light);
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.link-preview-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка "Показать полностью" */
.expand-post-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0 0 0;
    margin-top: 8px;
    transition: opacity 0.2s;
    display: inline-block;
}

.expand-post-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Меню поста */
.post-menu {
    position: relative;
    margin-left: auto;
}

.post-menu-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: all 0.2s;
}

.post-menu-btn:hover {
    background: var(--surface-hover);
}

.post-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 100;
    min-width: 160px;
    overflow: hidden;
    margin-top: 8px;
}

.post-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.2s;
}

.post-menu-dropdown button:hover {
    background: var(--surface-hover);
}

/* Комментарии */
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: var(--border-light);
}

.comment-body {
    flex: 1;
    background: var(--surface-hover);
    padding: 10px 14px;
    border-radius: 16px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    cursor: pointer;
    color: var(--text-primary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.comment-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.delete-comment-btn {
    position: absolute;
    right: -4px;
    top: -4px;
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}

.delete-comment-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Инпут комментария */
.comment-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.comment-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    font-size: 14px;
    color: var(--text-primary);
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-card);
}

.comment-image-btn,
.comment-send {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-image-btn:hover,
.comment-send:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.comment-image-btn:hover svg,
.comment-send:hover svg {
    stroke: white;
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: slideIn 0.25s ease;
}

/* Адаптив */
@media (max-width: 640px) {
    .post-card {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 12px;
    }
    
    .post-avatar {
        width: 40px;
        height: 40px;
    }
    
    .post-username {
        font-size: 15px;
    }
    
    .post-content {
        font-size: 14px;
    }
    
    .action-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    
    .views-count {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .link-preview-image {
        width: 60px;
        height: 60px;
    }
    
    .link-preview-title {
        font-size: 13px;
    }
}
/* Тулбар */
.feed-toolbar {
    display: flex;
    gap: 8px;
    background: var(--surface-card);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border-card);
}

.toolbar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn svg {
    stroke: var(--text-secondary);
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.toolbar-btn:hover svg {
    stroke: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

.toolbar-btn.active svg {
    stroke: white;
}

/* Иконка поиска */
.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 12px 16px 12px 42px;
    background: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-card);
}

/* Пост действия */
.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.2s;
}

.action-btn svg {
    stroke: var(--text-secondary);
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.action-btn:hover svg {
    stroke: var(--text-primary);
}

.action-btn.liked {
    color: var(--primary-color);
}

.action-btn.liked svg {
    stroke: var(--primary-color);
    fill: var(--primary-color);
    fill-opacity: 0.2;
}

.views-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 6px 12px;
    background: var(--surface-hover);
    border-radius: 30px;
}

.views-count svg {
    stroke: var(--text-secondary);
}
/* Глобальные переменные - темная тема с цветом 3f3f46 для карточек */
:root {
    --surface-card: #3f3f46;
    --surface-hover: #52525b;
    --background-page: #18181b;
    --border-light: #27272a;
    --border-card: #3f3f46;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Пост карточка с цветом 3f3f46 */
.post-card {
    background: #3f3f46;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #3f3f46;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    position: relative;
}

.post-card:last-child {
    margin-bottom: 0;
}

.post-card:hover {
    background: #52525b;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* Заголовок поста */
.post-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #27272a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.post-avatar img,
.post-avatar span {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-user-info {
    flex: 1;
    cursor: pointer;
}

.post-username {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

.post-handle {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
    padding: 4px 8px;
    background: #27272a;
    border-radius: 20px;
}

/* Контент поста */
.post-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 16px;
    padding: 4px 0;
}

/* Изображение поста */
.post-image {
    margin: 12px 0 16px 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #27272a;
    max-height: 500px;
}

.post-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.post-image:hover img {
    transform: scale(1.02);
}

/* Действия поста */
.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0 4px;
    border-top: 1px solid #27272a;
    margin-top: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.2s;
}

.action-btn svg {
    stroke: var(--text-secondary);
    transition: all 0.2s;
}

.action-btn:hover {
    background: #52525b;
    color: var(--text-primary);
}

.action-btn:hover svg {
    stroke: var(--text-primary);
}

.action-btn.liked {
    color: var(--primary-color);
}

.action-btn.liked svg {
    stroke: var(--primary-color);
    fill: var(--primary-color);
    fill-opacity: 0.2;
}

.spacer {
    flex: 1;
}

.views-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 6px 12px;
    background: #27272a;
    border-radius: 30px;
}

.views-count svg {
    stroke: var(--text-secondary);
}

/* Хэштеги */
.hashtag {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.hashtag:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Ссылки */
.post-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
    word-break: break-all;
}

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

/* Превью ссылок */
.link-preview-container {
    margin: 16px 0;
}

.link-preview {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: #27272a;
    border-radius: 12px;
    border: 1px solid #3f3f46;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.link-preview:hover {
    background: #3f3f46;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.link-preview-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #18181b;
}

.link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-preview-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.link-preview-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-preview-url {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Кнопка "Показать полностью" */
.expand-post-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0 0 0;
    margin-top: 8px;
    transition: opacity 0.2s;
    display: inline-block;
}

.expand-post-btn:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Меню поста */
.post-menu {
    position: relative;
    margin-left: auto;
}

.post-menu-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: all 0.2s;
}

.post-menu-btn:hover {
    background: #27272a;
}

.post-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #3f3f46;
    border: 1px solid #27272a;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 100;
    min-width: 160px;
    overflow: hidden;
    margin-top: 8px;
}

.post-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.2s;
}

.post-menu-dropdown button:hover {
    background: #52525b;
}

/* Комментарии */
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #27272a;
}

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: #27272a;
}

.comment-avatar img,
.comment-avatar span {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.comment-body {
    flex: 1;
    background: #27272a;
    padding: 10px 14px;
    border-radius: 16px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    cursor: pointer;
    color: var(--text-primary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.comment-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.delete-comment-btn {
    position: absolute;
    right: -4px;
    top: -4px;
    background: #3f3f46;
    border: 1px solid #27272a;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.comment:hover .delete-comment-btn {
    opacity: 1;
}

.delete-comment-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* Инпут комментария */
.comment-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.comment-input {
    flex: 1;
    padding: 10px 16px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 24px;
    font-size: 14px;
    color: var(--text-primary);
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #3f3f46;
}

.comment-image-btn,
.comment-send {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-image-btn:hover,
.comment-send:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.comment-image-btn:hover svg,
.comment-send:hover svg {
    stroke: white;
}

/* Тулбар */
.feed-toolbar {
    display: flex;
    gap: 8px;
    background: #3f3f46;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 20px;
    border: 1px solid #27272a;
}

.toolbar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn svg {
    stroke: var(--text-secondary);
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #52525b;
    color: var(--text-primary);
}

.toolbar-btn:hover svg {
    stroke: var(--text-primary);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

.toolbar-btn.active svg {
    stroke: white;
}

/* Панель поиска */
.search-panel {
    margin-bottom: 20px;
}

.search-card {
    background: #3f3f46;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #27272a;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    flex: 1;
    padding: 12px 16px 12px 42px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #3f3f46;
}

.search-submit-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.search-submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.search-filters {
    display: flex;
    gap: 8px;
    border-top: 1px solid #27272a;
    padding-top: 16px;
}

.search-filter {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid #3f3f46;
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.search-filter:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.search-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Создание поста */
.create-post {
    background: #3f3f46;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #27272a;
}

.create-post-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.create-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #27272a;
}

.create-post-input {
    flex: 1;
    padding: 10px 16px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.create-post-input:hover {
    background: #52525b;
    color: var(--text-primary);
    border-color: var(--primary-color);
}

/* Анимации */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: slideIn 0.25s ease;
}

/* Адаптив */
@media (max-width: 640px) {
    .post-card {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 12px;
    }
    
    .post-avatar {
        width: 40px;
        height: 40px;
    }
    
    .post-username {
        font-size: 15px;
    }
    
    .post-content {
        font-size: 14px;
    }
    
    .action-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    
    .views-count {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .link-preview-image {
        width: 60px;
        height: 60px;
    }
    
    .link-preview-title {
        font-size: 13px;
    }
}
/* Стили для ссылок и превью в сообщениях */
.message-link {
    color: var(--ac);
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
}

.message-link:hover {
    border-bottom-color: var(--ac);
}

.message-link-preview {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding: 10px;
    background: var(--bg3);
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    max-width: 280px;
    width: 100%;
    overflow: hidden;
}

.message-link-preview:hover {
    background: var(--bg2);
    transform: translateY(-1px);
}

.message-link-preview-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg2);
}

.message-link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-link-preview-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.message-link-preview-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--t1);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-link-preview-description {
    font-size: 11px;
    color: var(--t2);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.message-link-preview-url {
    font-size: 10px;
    color: var(--t3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Для исходящих сообщений - выравнивание вправо */
.messenger-message-out .message-link-preview {
    margin-left: auto;
    margin-right: 0;
}

/* Для входящих сообщений - выравнивание влево */
.messenger-message-in .message-link-preview {
    margin-left: 0;
    margin-right: auto;
}

/* Адаптив для мобильных */
@media (max-width: 600px) {
    .message-link-preview {
        max-width: 240px;
        padding: 8px;
        gap: 8px;
    }
    
    .message-link-preview-image {
        width: 50px;
        height: 50px;
    }
    
    .message-link-preview-title {
        font-size: 12px;
    }
    
    .message-link-preview-description {
        font-size: 10px;
        -webkit-line-clamp: 2;
    }
    
    .message-link-preview-url {
        font-size: 9px;
    }
}
/* Ограничение ширины сообщений */
.messenger-message {
    max-width: 80%;
    margin-bottom: 12px;
    position: relative;
}

.messenger-message-out {
    margin-left: auto;
    margin-right: 0;
}

.messenger-message-in {
    margin-left: 0;
    margin-right: auto;
}

.messenger-message-bubble {
    background: var(--bg2);
    border-radius: 18px;
    padding: 10px 14px;
    max-width: 100%;
    word-wrap: break-word;
}

/* Для исходящих сообщений - другой цвет */
.messenger-message-out .messenger-message-bubble {
    background: var(--ac);
    color: white;
}

.messenger-message-out .message-link {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.messenger-message-out .message-link-preview {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.messenger-message-out .message-link-preview-title,
.messenger-message-out .message-link-preview-description,
.messenger-message-out .message-link-preview-url {
    color: rgba(255, 255, 255, 0.9);
}

/* Адаптив для ширины сообщений */
@media (max-width: 600px) {
    .messenger-message {
        max-width: 90%;
    }
}
/* Ограничение размера изображения в превью ссылки */
.message-link-preview-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    min-width: 60px;
    max-width: 60px;
    min-height: 60px;
    max-height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg2);
}

.message-link-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Для более крупных превью - опционально */
.message-link-preview-image.large {
    width: 80px;
    height: 80px;
    min-width: 80px;
    max-width: 80px;
    min-height: 80px;
    max-height: 80px;
}

/* Для мобильных устройств - меньший размер */
@media (max-width: 600px) {
    .message-link-preview-image {
        width: 50px;
        height: 50px;
        min-width: 50px;
        max-width: 50px;
        min-height: 50px;
        max-height: 50px;
    }
    
    .message-link-preview-image.large {
        width: 65px;
        height: 65px;
        min-width: 65px;
        max-width: 65px;
        min-height: 65px;
        max-height: 65px;
    }
}
/* Анимация фона */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* Основной контейнер */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='10' cy='10' r='2' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='90' cy='20' r='3' fill='rgba(255,255,255,0.08)'/%3E%3Ccircle cx='50' cy='80' r='4' fill='rgba(255,255,255,0.06)'/%3E%3Ccircle cx='30' cy='50' r='2' fill='rgba(255,255,255,0.1)'/%3E%3Ccircle cx='80' cy='70' r='3' fill='rgba(255,255,255,0.08)'/%3E%3C/svg%3E");
    pointer-events: none;
    animation: pulse 8s ease infinite;
}

/* Контейнер с двумя колонками */
.auth-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Левая панель с информацией */
.auth-info {
    flex: 1;
    padding: 48px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    backdrop-filter: blur(10px);
}

.auth-info-content {
    color: white;
}

.auth-logo {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tagline {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.auth-description {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

.feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.feature-item svg {
    flex-shrink: 0;
    stroke: white;
}

.feature-item h4 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.feature-item p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.auth-stats {
    display: flex;
    gap: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.7;
}

/* Правая панель с формой */
.auth-card {
    width: 480px;
    padding: 48px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .auth-card {
    background: rgba(30, 30, 35, 0.95);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--t1);
}

.auth-subtitle {
    color: var(--tm);
    font-size: 14px;
}

/* Форма */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--t1);
}

.form-input {
    padding: 12px 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    color: var(--t1);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--ac);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.error-msg {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    color: var(--tm);
    font-size: 14px;
    margin-bottom: 8px;
}

.auth-link {
    color: var(--ac);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Адаптив */
@media (max-width: 968px) {
    .auth-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .auth-info {
        display: none;
    }
    
    .auth-card {
        width: 100%;
        padding: 32px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }
    
    .auth-header h2 {
        font-size: 28px;
    }
    
    .form-input {
        padding: 10px 14px;
    }
}