:root {
  --vk-blue: #0077FF;
  --vk-bg: #EDEEF0;
  --vk-header-bg: #FFFFFF;
  --vk-text: #000000;
  --vk-text-secondary: #818C99;
  --vk-border: #DCE1E6;
  --vk-input-bg: #F0F2F5;
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.2s var(--ease-out);
  --t-smooth: 0.35s var(--ease-bounce);
 --app-primary: #4a76a8;
 --app-primary-hover: #3b6694;
 --app-bg: #edeef0;
 --app-card: #ffffff;
 --app-text: #000000;
 --app-text-muted: #818c99;
--app-border: #dce1e6;
--radius: 12px;
--ease: cubic-bezier(0.4, 0, 0.2, 1);
--ease-bounce: cubic-bezier (0.34, 1.56, 0.64, 1);
        --fon-mesage: #8bb0ccbd;
        --fon-mesage2:#6e928ace;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* === ОСНОВНЫЕ ЦВЕТА === */
        --vk-blue: #0077FF;              /* Акцентный синий (остаётся ярким) */
        --vk-bg: #19191a;                /* Основной фон (глубокий тёмный) */
        --vk-header-bg: #222224;         /* Фон шапки (чуть светлее фона) */
        --vk-text: #ffffff;              /* Основной текст (белый) */
        --vk-text-secondary: #aaaaac;    /* Вторичный текст (мягкий серый) */
        --vk-border: #333336;            /* Границы (тёмно-серые, едва заметные) */
        --vk-input-bg: #2a2a2c;          /* Фон полей ввода */
        --border-vk: 1px solid #2a2e35;
        --fon-mesage: #58646d;
        --fon-mesage2:#0f0a10;
        --bleack:#000000;
        
        /* === АНИМАЦИИ (остаются без изменений) === */
        --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
        /* --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1); */
        --t-fast: 0.2s var(--ease-out);
        --t-smooth: 0.35s var(--ease-bounce);
        
        /* === APP-ПЕРЕМЕННЫЕ (дубликаты для совместимости) === */
        --app-primary: #0077FF;          /* Яркий акцент для тёмной темы */
        --app-primary-hover: #0066d6;    /* Чуть темнее при наведении */
        --app-bg: #19191a;               /* Фон страницы */
        --app-card: #222224;             /* Фон карточек/постов */
        --app-text: #ffffff;             /* Текст в карточках */
        --app-text-muted: #aaaaac;       /* Приглушённый текст */
        --app-border: #333336;           /* Границы карточек */
        
        /* === ОСТАЛЬНОЕ === */
        --radius: 12px;
        --ease: cubic-bezier(0.4, 0, 0.2, 1);
    }
}




*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--app-bg); color: var(--app-text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
/* Шапка */
.vk-header {
  transition: transform var(--t-fast);
  will-change: transform;
  background: linear-gradient(135deg, #8a43a1 0%, #160e21 100%);
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.vk-header.hidden { transform: translateY(-100%); }
.header-inner {  max-width: 1200px; margin: -5px auto; height: 45px; display: flex; align-items: center; padding: 0 16px; gap: 12px;}
.logo { font-size: 22px; font-weight: 700; color: var(--vk-blue); text-decoration: none; flex-shrink: 0; }
.search { flex: 1; max-width: 420px; }
.search input {
  width: 100%; padding: 8px 14px; border: 1px solid var(--vk-border);
  border-radius: 10px; background: var(--vk-input-bg); font-size: 14px; outline: none;
  transition: background-color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);}
.search input:focus { background: #fff; border-color: var(--vk-blue); box-shadow: 0 0 0 3px rgba(0,119,255,0.15); }

.nav-actions { display: flex; gap: 10px; margin-left: auto; }
.action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; text-decoration: none;
  color: var(--vk-text-secondary); font-size: 18px;
  transition: background-color var(--t-fast), color var(--t-fast), transform 0.2s;
}
.action-btn:hover { background: var(--vk-input-bg); color: var(--vk-blue); }
.action-btn:active { transform: scale(0.92); }
/* Гамбургер */
.menu-toggle {
  display: none; width: 40px; height: 40px;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; cursor: pointer; user-select: none; margin-left: auto;
}
.bar {
  display: block; width: 24px; height: 3px; background: var(--vk-text-secondary);
  border-radius: 2px; transition: transform var(--t-smooth), opacity 0.2s ease;
}
/* Мобильное меню */
.mobile-menu {
  position: fixed; top: 35px; left: 0; right: 0;
  background:var(--vk-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
  transform: translateY(-10px) scaleY(0.98); opacity: 0;
  pointer-events: none; transition: transform var(--t-smooth), opacity 0.25s ease, box-shadow 0.3s ease;
  z-index: 999; max-height: calc(100vh - 56px); overflow-y: auto;
}
.mobile-menu.active {
  transform: translateY(0) scaleY(1); opacity: 1; pointer-events: auto;
  box-shadow: 0 12px 40px rgba(114, 85, 155, 0.25);
}
.mobile-menu a {
  display: block; padding: 16px 20px; color: var(--vk-text); text-decoration: none;
  font-size: 15px; border-bottom: 1px solid var(--vk-border);
  transform: translateY(8px); opacity: 0;
  transition: transform var(--t-smooth), opacity 0.3s ease, background-color 0.2s;
}
.mobile-menu.active a { transform: translateY(0); opacity: 1; }
.mobile-menu.active a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.active a:nth-child(2) { transition-delay: 0.10s; }
.mobile-menu.active a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.active a:nth-child(4) { transition-delay: 0.20s; }.mobile-menu.active a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu a:hover { background: var(--vk-input-bg); }
.mobile-menu a:active { background: var(--vk-border); }
.mobile-menu a:last-child { border-bottom: none; }
/* Контент и Футер */
.content {
  flex: 1; padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.vk-footer { background: var(--vk-header-bg); border-top: 1px solid var(--vk-border); padding: 24px 16px; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: center; gap: 16px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-links a { color: var(--vk-text-secondary); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-links a:hover { color: var(--vk-text); }
.footer-copy { color: var(--vk-text-secondary); font-size: 12px; white-space: nowrap; }
/* Кнопки (унифицировано) */
.btn, #btnn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; background: #4a76a8; color: white;
  text-decoration: none; border-radius: 8px; border: none; cursor: pointer;
  font-weight: 600; transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.btn:hover, #btnn:hover { background: #3d6491; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(74,118,168,0.3); }
.btn:active, #btnn:active { transform: translateY(0); }
.btn-primary { background: #4caf50; }
.btn-primary:hover { background: #388e3c; box-shadow: 0 4px 12px rgba(76,175,80,0.3); }
.btn-danger { background: #f44336; }
.btn-danger:hover { background: #d32f2f; box-shadow: 0 4px 12px rgba(244,67,54,0.3); }
.btn-secondary { background: #9e9e9e; }
.btn-secondary:hover { background: #757575; }
.btn-small { padding: 6px 12px; font-size: 12px; }
/* Профиль / Посты (базовые стили) */
profile-header{background: var(--app-bg);}
.profile-page { max-width: 100%; margin: 0 auto; }
.profile-header { background: var(--app-bg); border-radius: 12px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.profile-cover { height: 200px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.profile-cover img { width: 100%; height: 170%; object-fit: cover; mix-blend-mode: soft-light; background-attachment: fixed; backdrop-filter: blur(82px) brightness(0.9); }
.profile-info { display: flex; padding: 3px; position: relative; }
.profile-avatar { position: relative; margin-right: 20px; }
.profile-avatar img { width: 150px; height: 150px; border-radius: 50%; border: 5px solid white; box-shadow: 0 4px 15px rgba(0,0,0,0.2); margin-top: -75px; object-fit: cover; }
.online-status { position: absolute; bottom: 10px; right: 10px; width: 20px; height: 20px; background: #4caf50; border: 3px solid white; border-radius: 50%; }
.profile-content { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.profile-sidebar { background:var(--vk-bg); border-radius: 12px; padding: 20px; height: fit-content; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.profile-main { background:var(--app-bg); border-radius: 10px; padding: 0px; box-shadow: 0 4px 20px rgb(237 238 240); }
.post {background: var(--app-bg); border: var(--vk-border);  border-radius: 10px; padding: 5px; margin-bottom: 5px; transition: transform 0.2s, box-shadow 0.2s;}
.comments-section { margin-top: 15px; padding-top: 15px; border-top: 2px solid #f0f2f5; }
/* === СПИСОК ДИАЛОГОВ === */
.messages-page { max-width: 800px; margin: 20px auto; padding: 0 16px; }
.messages-page h1 { font-size: 24px; margin-bottom: 16px; }
.dialogs-list { background: var(--app-card); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.08); overflow: hidden; }
.dialog-item { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--app-border); transition: background 0.2s var(--ease); cursor: pointer; }
.dialog-item:hover { background: #f5f7fa; }
.dialog-item:active { background: #eef1f5; transform: scale(0.995); }
.dialog-avatar { width: 50px; height: 50px; border-radius: 50%; margin-right: 14px; object-fit: cover; flex-shrink: 0; }
.dialog-info { flex: 1; min-width: 0; }
.dialog-info h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dialog-preview { font-size: 13px; color: var(--app-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.dialog-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: 10px; flex-shrink: 0; }
.dialog-time { font-size: 11px; color: var(--app-text-muted); }
.unread-badge { background: var(--app-primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 9px; min-width: 16px; text-align: center; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.online-dot.online { background: #4caf50; box-shadow: 0 0 0 2px var(--app-card); }
.online-dot.offline { background: #b0b3b8; box-shadow: 0 0 0 2px var(--app-card); }
/* === ЧАТ === */
.conversation-page { max-width: 800px; margin: 10px auto; padding: 0 16px; display: flex; flex-direction: column; height: calc(100vh - 130px); }
.conversation-header { background: var(--app-card); padding: 12px 16px; border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.conversation-partner { display: flex; align-items: center; gap: 1px; }
.partner-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.partner-info h2 { font-size: 16px; margin: 0; }
.partner-status { font-size: 12px; color: var(--app-text-muted); }
.partner-status.online { color: #4caf50; }
.messages-container { flex: 1; background: var(--app-card); border-radius: var(--radius); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scroll-behavior: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.message { display: flex; max-width: 80%; animation: msgSlideIn 0.35s var(--ease-bounce) forwards; }
.message.outgoing { margin-left: auto; flex-direction: row-reverse; }
@keyframes msgSlideIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.message-avatar { width: 32px; height: 32px; border-radius: 50%; margin: 0 8px; object-fit: cover; flex-shrink: 0; }
.message-content { background: var(--fon-mesage); padding: 10px 14px; border-radius: 18px; border-bottom-left-radius: 4px; position: relative; }
.message.outgoing .message-content { background:var(--fon-mesage2); border-bottom-left-radius: 18px; border-bottom-right-radius: 4px; }
.message-text { font-size: 15px; word-break: break-word; line-height: 1.4; }
.message-image img { max-width: 100%; border-radius: 12px; margin-top: 6px; cursor: zoom-in; transition: transform 0.2s var(--ease); }
.message-image img:hover { transform: scale(1.02); }
.message-audio audio { width: 200px; height: 32px; margin-top: 6px; border-radius: 16px; }
.message-meta { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 11px; color: var(--app-text-muted); justify-content: flex-end; }
.message-status { color: var(--app-primary); font-weight: bold; }
/* === ПАНЕЛЬ ВВОДА === */
.emoji-panel { background: var(--app-card); border: 1px solid var(--app-border); border-radius: var(--radius); padding: 10px; margin-top: 10px; max-height: 180px; overflow-y: auto; flex-wrap: wrap; gap: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.emoji-btn { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px; border-radius: 6px; transition: transform 0.15s var(--ease), background 0.15s; }
.emoji-btn:hover { background: #e8ebf0; transform: scale(1.15); }
.message-input-container { background: var(--app-card); padding: 12px; border-radius: 0 0 var(--radius) var(--radius); margin-top: 1px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
#message-form { display: flex; align-items: center; gap: 8px; }
.emoji-toggle, .file-upload-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; transition: background 0.2s var(--ease); font-size: 18px; }
.emoji-toggle:hover, .file-upload-btn:hover { background: #e8ebf0; }
#message-input { flex: 1; padding: 10px 14px; border: 1px solid var(--app-border); border-radius: 20px; outline: none; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s; }
#message-input:focus { border-color: var(--app-primary); box-shadow: 0 0 0 3px rgba(74,118,168,0.15); }
.send-btn { width: 38px; height: 38px; background: var(--app-primary); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s, background 0.2s; }
.send-btn:hover { background: var(--app-primary-hover); transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { background: #b0b3b8; cursor: not-allowed; transform: none; }
/* === ЧАТ  ТОЧКИ МЕНЮ=== */
.message-options{position:absolute;right: 15vh;border: none;}
/* ==================== МОДАЛЬНОЕ МЕНЮ ==================== */
.message-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 1000;

    min-width: 260px;
    padding: 10px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
    
    display: none;               /* скрыто по умолчанию, JS покажет */
    flex-direction: column;
    gap: 4px;

    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

/* ==================== СОСТОЯНИЕ "ОТКРЫТО" ==================== */
.message-menu[style*="display: block"],
.message-menu[style*="display: flex"] {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: menu-pop 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* ==================== РАЗМЫТЫЙ ФОН ПРИ ОТКРЫТОМ МЕНЮ ==================== */
body:has(.message-menu[style*="display: block"])::before,
body:has(.message-menu[style*="display: flex"])::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: none;         /* сквозь фон можно кликать (меню закроет JS) */
}

/* ==================== КНОПКИ ВНУТРИ МЕНЮ ==================== */
.message-menu button {
    all: unset;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #000000;
    background: #f2f3f5;
    cursor: pointer;
    transition: background 0.2s, padding-left 0.25s, transform 0.15s;
    user-select: none;
    white-space: nowrap;
}

.message-menu button:hover {
    background: #e5e7eb;
    padding-left: 24px;
}

.message-menu button:active {
    background: #d3d7df;
    transform: scale(0.97);
}

/* Удаление — красным, как в ВК */
.message-menu button[data-action="delete"] {
    color: #e53935;
}
.message-menu button[data-action="delete"]:hover {
    background: #ffebee;
}

/* ==================== АНИМАЦИЯ ПОЯВЛЕНИЯ ==================== */
@keyframes menu-pop {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ==================== ТЁМНАЯ ТЕМА (АВТО) ==================== */
@media (prefers-color-scheme: dark) {
    .message-menu {
        background: #242424;
        box-shadow: 0 12px 28px rgba(0,0,0,0.6);
    }
    .message-menu button {
        background: #2f2f2f;
        color: #e1e3e6;
    }
    .message-menu button:hover {
        background: #3d3d3d;
    }
    .message-menu button[data-action="delete"] {
        color: #ff6b6b;
    }
    .message-menu button[data-action="delete"]:hover {
        background: #452b2b;
    }
}

/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */
@media (max-width: 480px) {
    .message-menu {
        min-width: calc(100vw - 48px);
        border-radius: 20px;
    }
}

/*
ВХОД
*/
.auth-page {
border-radius: 13px;
    padding: 1rem;
    margin: 0rem 0rem;
    background: linear-gradient(327deg, #000000 0%, #755a7bad 100%);
    box-shadow: -4px 4px 18px 3px rgb(97 84 139 / 73%);
}
.auth-page h1 { margin: 0rem auto; text-align: center; font-size: 40px; }
.form-group { padding: 1rem 1rem 0 13%; }
.form-group input {
  
  padding: 14px 10px 18px 60px; margin: 0 0 10px 0; width: 79%;
  border: 1px solid #000000; border-radius: 17px;
  box-shadow: 0 1px 1px #552f2f21 inset, 0 1px 0 #388977;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
#username { background-position: 5px -2px !important; }
#password { background-position: 5px -52px !important; }
.form-group input:focus {
  background-color: #fff; border-color: #e8c291; outline: none;
  box-shadow: 0 0 0 1px #e8c291 inset;
}
.comments-section { margin-top: 15px; padding-top: 15px; border-top: 2px solid #f0f2f5; }
.comment { display: flex; margin: 10px 0; animation: commentSlide 0.3s var(--ease) forwards; }
@keyframes commentSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.comment-avatar { width: 35px; height: 35px; border-radius: 50%; margin-right: 10px; object-fit: cover; }
.comment-content { background: var(--app-border); padding: 10px 15px; border-radius: 18px; flex: 1; }
.comment-content strong { display: block; font-size: 13px; margin-bottom: 4px; color: #1a1a1a; }
.comment-content p { margin: 0; font-size: 14px; color:var(--vk-text); }
.comment-content small { display: block; font-size: 11px; color: #999; margin-top: 4px; }
.comment-form { display: flex; gap: 10px; margin-top: 10px; }
.comment-form input {
  flex: 1; padding: 7px 2px; border: 2px solid #989a9c; border-radius: 18px; font-size: 15px;
  transition: border-color 0.2s, background-color 0.2s, border-radius 0.2s;
}
.comment-form input:focus { background: #d1d1d1; border-radius: 9px; outline: none; border-color: #d03bdf; }
.comment-form button {
  padding: 9px 7px; background: #653e97; color: #c5b6b6; border: none; border-radius: 10px;
  cursor: pointer; font-weight: 600; transition: background-color 0.2s, transform 0.15s;
}
.like-btn, .comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    padding: 8px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;    gap: 6px;
    font-weight: 500;
    transition: all 0.2s;
}
.like-btn:hover, .comment-btn:hover {
    background: #f0f2f5;
}
.post-actions {
    display: flex;
    gap: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f2f5;
}
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.post-date {
    display: block;
    font-size: 12px;
    color: #999;
}
.delete-post {
    position: absolute;
    right: 0;
    top: 0;
    background: none;
    border: none;
    color: #999;    cursor: pointer;
    font-size: 20px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.delete-post:hover {
    background: #ffebee;
    color: #f44336;
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.6;
    color:  var(--vk-text);
    font-size: 15px;
}

.post-media {
    margin: 15px 0;
}

.post-photo {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 10px;
}

.post-actions {
    display: flex;
    gap: 15px;
    padding-top: 15px;
    border-top:var(--border-vk);
}

.comment-form button:hover { background: #216141; transform: scale(1.05); }
.comment-form button:active { transform: scale(0.95); }

.vk-header.hidden { transform: translateY(-100%); }

/* === ЛИНИЯ ЗАГРУЗКИ (как в VK/YouTube) === */
.loader-bar {
  position: fixed; top: 0; left: 0;
  width: 0%; height: 3px;
  background: linear-gradient(90deg, #0077FF, #8a43a1, #0077FF);
  background-size: 200% 100%;
  animation: gradientMove 1.2s linear infinite;
  z-index: 10000;
  box-shadow: 0 0 10px rgba(0, 119, 255, 0.4);
  pointer-events: none;
  transition: width 0.3s ease, opacity 0.4s ease;
}
@keyframes gradientMove {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

profile-section {
    background: var(--app-bg);
}

.profile-sidebar {
    background: var(--app-bg);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;    font-size: 28px;
    font-weight: bold;
    color: #4a76a8;
}

.stat-label {
    color: #666;
    font-size: 13px;
}

.profile-info-block h3 {
    margin-bottom: 15px;
    color: #4a76a8;
    font-size: 18px;
}

.profile-info-block p {
    margin: 10px 0;
    color: #333;
    font-size: 14px;
}
.create-post {
    background:var(--app-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.create-post h3 {
    margin-bottom: 15px;
    color: #4a76a8;
}

.create-post textarea {
    color: var(--vk-text);
    background: var(--vk-border);
    width: 100%;
    min-height: 80px;
    padding: 15px;
    border: 2px solid #e1e3e6;
    border-radius: 12px;
    resize: vertical;
    margin-bottom: 10px;
    font-family: inherit;    font-size: 14px;
}

.create-post textarea:focus {
    outline: none;
    border-color: #4a76a8;
}
.friends-page {
    max-width: 1000px;
    margin: 0 auto;
}

.friends-page h1 {
    color: white;
    margin-bottom: 20px;
    font-size: 32px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.friends-search {
    margin-bottom: 20px;
    position: relative;
}
.friends-search input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e3e6;
    border-radius: 12px;
    font-size: 16px;
    background: var(--vk-bg);
    transition: all 0.3s;
    color: var(--vk-text);
}

.friends-search input:focus {
    outline: none;
    border-color: #4a76a8;
    box-shadow: 0 0 0 3px rgba(74, 118, 168, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e3e6;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 100;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f5f6f8;
}

.friends-section {
    background: var(--vk-bg);
    border-radius: 12px;
    padding:0px;
    margin-bottom:0px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.friends-section h2 {
    margin: 0 0 20px;
    color: #4a76a8;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: #4a76a8;
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.friend-card {
    display: flex;
    align-items: center;
    padding:2px;    border: 2px solid #73437c;
    border-radius: 10px;
    transition: all 0.3s;
    position: relative;
    background:var(--vk-bg);
    color: var(--vk-text);
}

.friend-card:hover {
    border-color: #4a76a8;
    box-shadow: 0 4px 12px rgba(74, 118, 168, 0.2);
    transform: translateY(-3px);
}

.friend-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 3px solid #f0f2f5;
}

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

.friend-info h3 {
    margin: 0 0 5px;
    font-size: 15px;
    color:var(--vk-text);
    font-weight: 600;
}

.friend-city {
    margin: 0;
    font-size: 13px;
    color: #888;
}

.friend-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 15px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f5f6f8;
}

.search-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;    margin-right: 12px;
    object-fit: cover;
}

.search-info {
    flex: 1;
}

.search-info strong {
    display: block;
    color: #1a1a1a;
    font-size: 14px;
}
.post-options-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    list-style: none;
    padding: 5px 0;
    margin: 0;
    min-width: 150px;
    /* display: none; уже задано в HTML */
}

.post-options-menu a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: black;
    cursor: pointer;
}

.post-options-menu a:hover {
    background-color: #f0f2f5;
}
/* Кнопка "три точки" */
.post-options-trigger {
    background: none;
    border: none;
    font-size: 18px; /* Размер точек */
    cursor: pointer;
    padding: 4px; /* Отступы для удобства клика */
    margin-left: 8px; /* Отступ от даты */
    border-radius: 4px; /* Скругление при наведении */
    color: #666; /* Цвет точек */
    position: relative; /* Для позиционирования меню */
    opacity: 0; /* Скрыта по умолчанию */
    transition: opacity 0.2s ease-in-out, color 0.2s ease-in-out;
}

/* Показываем кнопку при наведении на весь пост */
.post:hover .post-options-trigger {
    opacity: 1;
    color: #333;
}

/* Меню "три точки" */
.post-options-menu {
    position: absolute;
    top: 100%; /* Позиционируем под кнопкой */
    right: 0; /* Выравнивание по правому краю кнопки */
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    list-style: none;
    padding: 4px 0;
    margin: 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out, transform 0.2s ease-out;
}

.post-options-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.post-options-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-options-menu li {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px; /* Отступ между иконкой и текстом */
    color: #333;
    font-size: 14px;
}

.post-options-menu li:hover {
    background-color: #f0f2f5;
}

.post-options-menu li i {
    font-style: normal; /* Сбрасываем курсив для иконок-символов */
    width: 20px; /* Ширина для выравнивания иконок */
    text-align: center;
    font-size: 16px;
}

/* Стили для модального окна поделиться (если понадобится) */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.share-modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.share-modal-header h3 {
    margin: 0;
}

.close-share-modal {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
}

.share-friends-list {
    max-height: 300px;
    overflow-y: auto;
}

.share-friend-item {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.share-friend-item:hover {
    background-color: #f0f2f5;
}

.share-friend-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.share-friend-name {
    font-weight: 500;
}

.share-post-btn {
    margin-top: 15px;
    width: 100%;
}
.post-header {
    display: flex; /* Основной контейнер - строка */
    align-items: center; /* Выравнивание по вертикали по центру */
    justify-content: space-between; /* Распределение пространства: один элемент слева, другой справа */
    margin-bottom: 15px;
    position: relative;
}

/* Кнопка "три точки" */
.post-options-trigger {
    background: none;
    border: none;
    font-size: 18px; /* Размер точек */
    cursor: pointer;
    padding: 4px; /* Отступы для удобства клика */
    margin-left: 8px; /* Отступ от даты или от края */
    border-radius: 4px; /* Скругление при наведении */
    color: #666; /* Цвет точек */
    position: relative; /* Для позиционирования меню */
    opacity: 1; /* ВСЕГДА видима */
    transition: color 0.2s ease-in-out; /* Плавный переход цвета */
    /* Убираем: opacity: 0; и transition: opacity ... */
}

.post-options-trigger:hover {
    color: #333; /* Темнее при наведении */
}

/*
// Старый стиль для скрытия/показа при наведении на пост
.post:hover .post-options-trigger {
    opacity: 1;
    color: #333;
}
.profile-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.section-header h3 {
    margin: 0;
    font-size: 20px;
}

/* Альбомы */
.albums-section {
    margin-bottom: 30px;
}

.albums-section h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.album-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.album-cover {
    position: relative;
    height: 140px;
    background: #e9ecef;
    overflow: hidden;
}

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

.no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #adb5bd;
}

.album-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.album-card:hover .album-overlay {
    opacity: 1;
}

.album-overlay span {
    font-size: 24px;
    color: #fff;
}

.album-info {
    padding: 12px;
}

.album-info h5 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-info p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}
.photos-section {
    background: var(--app-bg);

    color:var(--vk-text);
}

/* Фотографии */
.photos-section h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.photo-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Модальное окно */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photo-modal img {
    max-width: 99%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 5px;
}

.no-content {
    text-align: center;
    color:var(--vk-text);
    padding: 40px;
    background:var(--vk-bg);
    border-radius: 8px;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}


.admin-page { padding: 20px; color: var(--vk-text); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--vk-card); border-radius: 12px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid var(--vk-border); text-align: left; }
.admin-table th { background: var(--vk-hover); }
.stat-card { background: var(--vk-card); border-radius: 12px; padding: 20px; text-align: center; font-size: 18px; }
.admin-menu { display: flex; gap: 12px; margin-top: 20px; }
.admin-menu a { padding: 8px 16px; background: var(--vk-primary); color: #fff; border-radius: 8px; text-decoration: none; }





















/* ===== VK-STYLE: СОЗДАНИЕ ПОСТА ===== */
.vk-create-post-wrapper {
    margin-bottom: 20px;
}

.create-post {
    background: var(--app-card);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--app-border);
}

.vk-post-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.vk-post-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.vk-post-input-wrapper textarea {
    flex: 1;
    border: none;
    outline: none;
    background: var(--vk-input-bg);
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    color: var(--app-text);
    transition: box-shadow 0.2s;
}

.vk-post-input-wrapper textarea:focus {
    box-shadow: 0 0 0 3px rgba(74,118,168,0.15);
}

.vk-post-input-wrapper textarea::placeholder {
    color: var(--app-text-muted);
}

.vk-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--app-border);
}

.vk-post-attachments {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vk-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--vk-input-bg);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: var(--app-text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.vk-attach-btn:hover {
    background: var(--app-border);
    border-color: var(--app-primary);
    color: var(--app-primary);
}

.vk-attach-btn input {
    display: none;
}

.vk-publish-btn {
    background: var(--app-primary);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.vk-publish-btn:hover:not(:disabled) {
    background: var(--app-primary-hover);
    transform: translateY(-1px);
}

.vk-publish-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== VK-STYLE: СЕТКА ФОТОГРАФИЙ ===== */
.post-media {
    margin: 12px 0;
    border-radius: 10px;
    overflow: hidden;
}

.post-photo {
    display: block;
    cursor: pointer;
    transition: transform 0.2s var(--ease);
    width: 100%;
    height: auto;
    object-fit: cover;
    image-orientation: from-image; /* ✅ Исправляет ориентацию */
}

.post-photo:hover {
    transform: scale(1.02);
}

/* 1 фото — полноэкранное */
.post-media .post-photo:only-child {
    width: 100%;
    max-height: 500px;
    border-radius: 10px;
}

/* 2 фото — 2 колонки */
.post-media:has(.post-photo:nth-child(2)):not(:has(.post-photo:nth-child(3))) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.post-media:has(.post-photo:nth-child(2)):not(:has(.post-photo:nth-child(3))) .post-photo {
    height: 250px;
    border-radius: 8px;
}

/* 3 фото — большая + 2 маленькие */
.post-media:has(.post-photo:nth-child(3)):not(:has(.post-photo:nth-child(4))) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 4px;
}
.post-media:has(.post-photo:nth-child(3)):not(:has(.post-photo:nth-child(4))) .post-photo:first-child {
    grid-row: 1 / -1;
    border-radius: 10px 0 0 10px;
}
.post-media:has(.post-photo:nth-child(3)):not(:has(.post-photo:nth-child(4))) .post-photo:not(:first-child) {
    border-radius: 0 10px 10px 0;
}

/* 4 фото — сетка 2×2 */
.post-media:has(.post-photo:nth-child(4)):not(:has(.post-photo:nth-child(5))) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 4px;
}
.post-media:has(.post-photo:nth-child(4)):not(:has(.post-photo:nth-child(5))) .post-photo {
    border-radius: 8px;
}

/* 5+ фото — 3 колонки */
.post-media:has(.post-photo:nth-child(5)) {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
    gap: 4px;
}
.post-media:has(.post-photo:nth-child(5)) .post-photo {
    border-radius: 8px;
}

/* ===== VK-STYLE: АУДИО-ПЛЕЕР ===== */
.post-audio, .vk-audio-player {
    margin: 12px 0;
    padding: 12px 16px;
    background: var(--vk-input-bg);
    border-radius: 10px;
    border: 1px solid var(--app-border);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.vk-audio-icon {
    width: 40px;
    height: 40px;
    background: var(--app-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 18px;
}

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

.vk-audio-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--app-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.vk-audio-meta {
    font-size: 12px;
    color: var(--app-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-audio audio {
    width: 100%;
    max-width: 300px;
    height: 32px;
    border-radius: 16px;
}

/* ===== ПРЕВЬЮ В ФОРМЕ ===== */
.photo-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.photo-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--app-border);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(244,67,54,0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-preview-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--vk-input-bg);
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
}

.audio-preview-container .vk-audio-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.audio-preview-container audio {
    flex: 1;
    max-width: 200px;
    height: 28px;
}

.audio-preview-remove {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 480px) {
    .post-media:has(.post-photo:nth-child(2)):not(:has(.post-photo:nth-child(3))),
    .post-media:has(.post-photo:nth-child(3)):not(:has(.post-photo:nth-child(4))),
    .post-media:has(.post-photo:nth-child(4)):not(:has(.post-photo:nth-child(5))) {
        grid-template-rows: 180px 180px;
    }
    .post-media:has(.post-photo:nth-child(5)) {
        grid-auto-rows: 150px;
    }
    
    .vk-post-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .vk-post-attachments {
        justify-content: center;
    }
    
    .vk-publish-btn {
        width: 100%;
    }
}