: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);
}
*, *::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: 56px; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.92);
  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-page { max-width: 99%; margin: 0 auto; }
.profile-header { background: white; 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: white; border-radius: 12px; padding: 20px; height: fit-content; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.profile-main { background: #d7d7d79c; border-radius: 10px; padding: 0px; box-shadow: 0 4px 20px rgb(237 238 240); }
.post { background: white; border: 2px solid #e1e3e6; border-radius: 12px; padding: 20px; margin-bottom: 20px; transition: transform 0.2s, box-shadow 0.2s; }.post:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.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: 12px; }
.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: #f0f2f5; padding: 10px 14px; border-radius: 18px; border-bottom-left-radius: 4px; position: relative; }
.message.outgoing .message-content { background: #e3f2fd; border-bottom-left-radius: 18px; border-bottom-right-radius: 4px; }
.message-text { font-size: 14px; 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; }

/*
ВХОД
*/
.auth-page {
  border-radius: 22px; padding: 1rem; margin: 1rem 2rem;
  background: linear-gradient(327deg, #163933 0%, #daafe3ad 100%);
  box-shadow: -4px 4px 18px 3px rgb(97 84 139 / 73%);
}
.auth-page h1 { margin: 1rem auto; text-align: center; font-size: 50px; }
.form-group { padding: 1rem 1rem 0 13%; }
.form-group input {
  background: #cbc9c9b8 url(images/login-sprite.png) no-repeat;
  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: #f0f2f5; 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: #333; }
.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: #333;
    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: 2px solid #f0f2f5;
}

.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; }
}

/* === СКЕЛЕТОН-ЗАГЛУШКИ (для контента) === */
.skeleton {
  background: linear-gradient(90deg, #f0f2f5 25%, #e4e6eb 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-text { height: 16px; margin-bottom: 10px; width: 90%; }
.skeleton-text.short { width: 60%; }
.skeleton-avatar { width: 50px; height: 50px; border-radius: 50%; }
.skeleton-post { height: 280px; margin-bottom: 20px; border-radius: 12px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Адаптив скелетона */
@media (max-width: 768px) {
  .skeleton-post { height: 220px; }
  .skeleton-avatar { width: 40px; height: 40px; }
}
