/* ========== ОСНОВНЫЕ ПЕРЕМЕННЫЕ (светлая тема) ========== */
: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: #000000;
  --app-border: #dce1e6;
  --radius: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fon-mesage: #8bb0ccbd;
  --fon-mesage2: #6e928ace;
  --fon-message3: linear-gradient(to right, #9155e8, #b992ca), #0c151dd4;
  --bg-message: linear-gradient(to right, #9155e8, #b992ca), #0c151dd4;
  --bg-message2: linear-gradient(to right, #8e3697, #80729f), #121927;
  --header-height: 35px;      /* для адаптивности */
  --vk-primary: #4a76a8;      /* для админки */
  --vk-card: #ffffff;
  --vk-hover: #f0f2f5;
}

/* ========== ТЁМНАЯ ТЕМА ========== */
@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;
    --fon-mesage: #58646d;
    --fon-mesage2: #0f0a10;
    /* анимации */
    --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: #0077FF;
    --app-primary-hover: #0066d6;
    --app-bg: #19191a;
    --app-card: #222224;
    --app-text: #ffffff;
    --app-text-muted: #e0e0e4;
    --app-border: #333336;
    --radius: 12px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --fon-message3: #241229;
    --bg-message: linear-gradient(to right, #050809, #42035d), #000000d4;
    --bg-message2: linear-gradient(to right, #22485f, #1f1423), #283655;
    --vk-primary: #0077FF;
    --vk-card: #222224;
    --vk-hover: #2a2a2c;
  }
}

/* ========== СБРОС ========== */
*, *::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);
  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%;
  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 — теперь только в .active */
  box-shadow: 0 4px 12px 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);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.mobile-menu a {
  display: block;
  padding: 16px 20px;
  color: var(--vk-text);
  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: 0;                 /* убрали боковые отступы */
  max-width: 100%;            /* на всю ширину */
  margin: 0;
  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);
  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;
  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: 100%; margin: 0 auto; }
.profile-header { background: var(--app-bg); border-radius: 12px; overflow: hidden; margin-bottom: 2px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.profile-cover { height: 178px; 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); }



.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: var(--vk-text); font-size: 14px; }

/* ========== ПОСТЫ (с анимацией появления как в ВК) ========== */
.post {
  background: var(--app-bg);
  border: 1px solid var(--app-border);   /* исправлено: теперь валидный бордер */
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 5px;
  transition: transform 0.2s, box-shadow 0.2s;
  /* анимация появления при скролле */
  opacity: 0;
  transform: translateY(20px);
  /*will-change: transform, opacity;*/
}
.post.post-visible {
  opacity: 1;
  /* transform: translateY(0); */
  /* transition: opacity 0.4 sease-out, transform 0.4 sease-out; */
}
.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: 1px solid var(--app-border);
}
.post-edited {
    font-size: 11px;
    color: #939cb0;
    font-style: italic;
    margin-left: 4px;
    cursor: help;
}

/* Кнопка "три точки" всегда видимая */
.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;
}
.post-options-trigger:hover { 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 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; }
.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-post-btn { margin-top: 15px; width: 100%; }

/* ========== КОММЕНТАРИИ ========== */
.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;
}
.comment-form button:hover { background: #216141; transform: scale(1.05); }
.comment-form button:active { transform: scale(0.95); }

.like-btn, .comment-btn {
  background: none;
  border: 1px solid var(--app-border);
  cursor: pointer;
  font-size: 14px;
  color: var(--app-text-muted);
  padding: 8px 15px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.2s;
}
.like-btn:hover, .comment-btn:hover { background: #f0f2f5; }
.like-btn.liked { color: #e91e63; border-color: #e91e63; background: #fce4ec; }

.post-video {
    width: 100%;
    max-height: 500px;
    background: #000;
    border-radius: 8px;
    display: block;
}
.video-slide {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

 .create-post {
                      background: var(--app-bg);
                        border-radius: 8px;
                        padding: 15px;
                        margin-bottom: 15px;
                        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
                    }





.create-post h3 { margin-bottom: 15px; color: #4a76a8; }
.create-post textarea {
 color: var(--app-text);
    background: var(--vk-input-bg);
    width: 100%;
    min-height: 48px;
    padding: 0px 97px;
    border: 1px solid #e1e3e6;
    border-radius: 6px;
    resize: vertical;
    margin-bottom: 0px;
    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: white;
  transition: all 0.3s;
}
.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; }
.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; }
.friends-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  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: 15px;
  border: 2px solid #e1e3e6;
  border-radius: 10px;
  transition: all 0.3s;
  position: relative;
  background: white;
}
.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: #1a1a1a; font-weight: 600; }
.friend-city { margin: 0; font-size: 13px; color: #888; }
.friend-actions { display: flex; flex-direction: column; gap: 8px; margin-left: 15px; }

/* ========== АЛЬБОМЫ / ФОТО (исправлены селекторы) ========== */
.profile-section {
     background: var(--app-bg);
    border-radius: 12px;
    padding: 0px;
    margin-top: 11px;
   
}
.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(--app-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; }

/* ========== ЛИНИЯ ЗАГРУЗКИ ========== */
.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; }
}

/* ========== АВТОРИЗАЦИЯ ========== */
.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;
}

/* ========== СООБЩЕНИЯ (НЕ ТРОГАЛ – ваш исходный код) ========== */
/* === СПИСОК ДИАЛОГОВ === */
.messages-page { max-width: 800px; margin: 0px 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: 0px 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: 16px; }
.partner-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.partner-info h2 { font-size: 16px; margin: 0; }
.partner-status { 
  width: 70px;
    margin: 0px 129px;
    padding: 0px 5px;
    top: 0px;
    position: absolute;
    /* left: 244px; */
    font-size: 11px;
    color: var(--app-text);
 }
.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 {margin: -3px -6px; 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: 1px; border-radius: 0 0 var(--radius) var(--radius);margin: 2px 1px;; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
#message-form { display: flex; align-items: center; gap: 8px;margin: -3px 5px; }
.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 1px; border: 1px solid var(--app-border); border-radius: 10px; 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: 10000 !important;  /* Принудительно высокий z-index */

    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 {

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




/* ========== ГОРИЗОНТАЛЬНАЯ КАРУСЕЛЬ В ПОСТАХ (исправленная) ========== */

.media-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}










/* Карусель – применяется везде, где есть .media-carousel */
.media-carousel {
    position: relative;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    display: flex;
    scrollbar-width: none;
}
.media-carousel::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

/* ✅ Счётчик "1 / 5" */
.media-counter {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(4px);
}




.media-carousel,
.post .post-media .media-carousel {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    width: 100% !important;
    max-width: 100%;
    gap: 0;
    padding: 0;
    margin: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.media-carousel::-webkit-scrollbar,
.post .post-media .media-carousel::-webkit-scrollbar {
    display: none;
}
.carousel-slide,
.post .post-media .carousel-slide {
    flex: 0 0 100% !important;
    scroll-snap-align: start;
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
}
.carousel-slide .post-photo,
.post .post-media .carousel-slide .post-photo {
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain;
    margin: 0 !important;
    display: block !important;
}
/* Один слайд – скрываем скролл */
.media-carousel.single-slide,
.post .post-media .media-carousel.single-slide {
    overflow-x: hidden !important;
}