/* === GLOBAL LAYOUT FIXES (KEEP) === */

/* Feed item styling */
.galaxy2-feed-item img {
  width: 100% !important;
  height: auto !important;
  border-radius: 10px !important;
}

.galaxy2-feed-item {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
  margin-bottom: 18px !important;
}

body {
  font-size: 18px;
  line-height: 1.45;
}

.galaxy2-page-layout {
  padding: 0 12px;
  gap: 14px;
}

.galaxy2-content-center,
.galaxy2-postbox,
.galaxy2-feed-item {
  border-radius: 10px;
  padding: 12px;
}

.galaxy2-postbox {
  background: #ffffff;
}

.galaxy2-postbox textarea {
  font-size: 17px;
  padding: 10px;
}

.galaxy2-post-actions button,
#galaxy2-postbox-submit {
  font-size: 17px;
  padding: 12px;
}

.galaxy2-horizontal-bar-wrapper img,
.galaxy2-card img {
  height: 140px !important;
}

/* Unified post image sizes */
.galaxy-post img,
.post img,
.entry-content img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ============================================================
 === MOBILE VERSION (FACEBOOK STYLE) — CLEAN, FINAL ===
 ============================================================ */

@media (max-width: 768px) {

  /* Fixed mobile header */
  .g2-mobile-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 52px;
      background: #ffffff;
      border-bottom: 1px solid #e5e7eb;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 14px;
      z-index: 9999;
  }

  .g2-mobile-menu-btn {
      font-size: 26px;
      background: none;
      border: none;
      cursor: pointer;
  }

  .g2-mobile-logo {
      font-size: 20px;
      font-weight: 700;
  }

  .g2-mobile-profile {
      width: 28px;
      height: 28px;
      background: #d1d5db;
      border-radius: 50%;
  }

  /* Slide-out menu */
  .g2-mobile-slide-menu {
      position: fixed;
      top: 0;
      left: -260px;
      width: 240px;
      height: 100vh;
      background: #ffffff;
      border-right: 1px solid #e5e7eb;
      padding: 60px 10px 10px;
      transition: left 0.3s ease;
      z-index: 9998;
  }

  .g2-mobile-slide-menu.open {
      left: 0;
  }

  .g2-mobile-menu-items a {
      display: block;
      padding: 10px 12px;
      border-radius: 6px;
      background: #f3f4f6;
      margin-bottom: 6px;
      text-decoration: none;
      color: #111827;
      font-weight: 600;
  }

  /* Hide desktop sidebars */
  .galaxy2-sidebar-left,
  .galaxy2-sidebar-right {
      display: none !important;
  }

  /* One-column layout */
  .galaxy2-page-layout {
      margin-top: 60px !important;
      grid-template-columns: 1fr !important;
      padding: 0 12px !important;
  }
}

/* ============================================================
 === HIDE MOBILE MENU ON DESKTOP (FIX DOUBLE MENUS) ===
 ============================================================ */

@media (min-width: 769px) {
  .g2-mobile-header,
  .g2-mobile-slide-menu {
      display: none !important;
  }
}

.g2-author-block {
  margin: 10px 0 15px 0;
  padding: 8px 12px;
  background: #f3f6fa;
  border-left: 3px solid #0A2540;
  border-radius: 4px;
}

.g2-author-name {
  font-weight: 600;
  color: #0A2540;
}

.g2-author-date {
  font-size: 13px;
  color: #6b7a90;
}

/* Hide Edit/Delete buttons in Classifieds */
.g2c-btn-edit,
.g2c-btn-delete {
    display: none !important;
}

/* 1. Hide "My Posts" button */
div[style*="flex-direction:column"] a[href="/my-posts/"] {
  display: none !important;
}

/* 2. Move "Go to Home" button to the top-left */
div[style*="flex-direction:column"] {
  max-width: 100% !important;
  margin: 0 auto 20px auto !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

/* 3. Expand Notifications block vertically */
.notifications-block {
  max-width: 600px !important;
  margin: 20px auto !important;
  width: 100% !important;
}

/* === USER CABINET — TWO COLUMN LAYOUT === */

/* Turn main wrapper into 2 columns */
.user-cabinet-wrapper {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 30px !important;
  align-items: start !important;
}

/* Move Go to Home + Profile + Notifications to left column */
.user-cabinet-wrapper,
.notifications-block {
  grid-column: 1 / 2 !important;
}

/* Admin Panel moves to right column */
.admin-panel-block {
  grid-column: 2 / 3 !important;
  width: 100% !important;
}

/* Hide My Posts */
div[style*="flex-direction:column"] a[href="/my-posts/"] {
  display: none !important;
}

/* Move Go to Home to top-left */
div[style*="flex-direction:column"] {
  grid-column: 1 / 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  margin: 0 !important;
}

/* NEWS portals grid */
.galaxy-news-portals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin: 30px 0;
}

/* Single portal tile */
.g2-news-portal {
  background: #f5f5f5;
  padding: 18px 20px;
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
  border: 1px solid #ddd;
}

.g2-news-portal:hover {
  background: #e8e8e8;
  transform: translateY(-3px);
}

/* NEWS portals — Galaxy2 style */
.galaxy-news-portals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin: 30px 0;
}

.g2-news-portal {
  background: #d9ecff;
  color: #003366;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: 1px solid #bcdcff;
  transition: 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.g2-news-portal:hover {
  background: #cfe6ff;
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.g2-news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 20px 10px;
  animation: fadeIn 0.6s ease-out;
}

.g2-news-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  padding: 18px 10px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  color: #222;
  transition: all 0.25s ease;
}

.g2-news-portal:hover {
  background: #f0f8ff;
  border-color: #0077ff;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Tablet */
@media (max-width: 900px) {
  .g2-news-grid {
      grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .g2-news-grid {
      grid-template-columns: 1fr;
  }
}

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* Универсальный hover для всех языковых кнопок */
.g2-lang {
  position: relative;
  transition: all 0.25s ease;
}

.g2-lang:hover {
  background-color: #1e90ff;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* Универсальный tooltip */
.g2-tooltip {
  position: absolute;
  bottom: -55px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  width: 240px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Показываем tooltip при наведении */
.g2-lang:hover .g2-tooltip {
  opacity: 1;
}

/* === FIX TOOLTIP PRIORITY — FINAL === */

.g2-lang {
  position: relative !important;
}

.g2-tooltip {
  position: absolute !important;
  top: -60px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.g2-lang:hover .g2-tooltip {
  opacity: 1 !important;
}

/* === NEWS — трёхколоночная сетка === */
.g2-news-layout {
  display: grid;
  grid-template-columns: 260px 1fr 320px; /* ЛЕВАЯ — ЦЕНТР — ПРАВАЯ */
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px;
  box-sizing: border-box;
}

/* === Левая колонка === */
.g2-news-menu {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  padding: 15px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.4;
}

.g2-menu-section {
  margin-bottom: 18px;
  padding-left: 0;
  list-style: none;
}

.g2-menu-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 16px;
}

.g2-submenu,
.g2-submenu-inner {
  list-style: none;
  padding-left: 12px;
  margin: 6px 0;
}

.g2-submenu a,
.g2-menu-section a {
  text-decoration: none;
  color: #333;
  display: block;
  padding: 4px 0;
}

.g2-submenu a:hover,
.g2-menu-section a:hover {
  color: #0073aa;
}

/* === Центр (Postbox + лента) === */
.g2-news-center {
  background: #ffffff;
  padding: 10px;
  border-radius: 6px;
}

/* === Правая колонка === */
.g2-news-right {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  padding: 15px;
  border-radius: 6px;
}

/* === HOME | NEWS — навигация === */
.g2-news-topnav {
  text-align: center;
  margin: 20px 0;
}

.g2-news-topnav a {
  display: inline-block;
  margin: 0 10px;
  padding: 6px 14px;
  font-size: 17px;
  text-decoration: none;
  color: #333;
  border-radius: 4px;
}

.g2-news-topnav a:hover {
  background: #f0f0f0;
}

/* === Адаптивность === */
@media (max-width: 1024px) {
  .g2-news-layout {
      grid-template-columns: 220px 1fr;
  }
  .g2-news-right {
      display: none;
  }
}

@media (max-width: 768px) {
  .g2-news-layout {
      grid-template-columns: 1fr;
  }
  .g2-news-menu {
      margin-bottom: 20px;
  }
}

/* === POSTBOX — красивый блок === */
.g2-postbox-area {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.g2-postbox-area h3,
.g2-postbox-area label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.g2-postbox-area input[type="text"],
.g2-postbox-area textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 15px;
}

.g2-postbox-area button,
.g2-postbox-area input[type="submit"] {
  background: #0073aa;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

.g2-postbox-area button:hover,
.g2-postbox-area input[type="submit"]:hover {
  background: #005f8a;
}

/* === TOP NAVIGATION BUTTONS === */
.g2-news-topnav {
  text-align: center;
  margin: 25px 0 30px;
}

.g2-news-topnav a {
  display: inline-block;
  padding: 10px 22px;
  margin: 0 8px;
  background: #f5f5f5;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  transition: 0.2s;
}

.g2-news-topnav a:hover {
  background: #e9e9e9;
}

.g2-news-topnav a.active {
  background: #0073aa;
  color: white;
  border-color: #0073aa;
}

.g2c-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.g2c-header-actions {
  display: flex;
  gap: 10px;
}

.g2-nav-btn {
  padding: 10px 20px;
  background: #1d4ed8;
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s ease;
}

.g2-nav-btn:hover {
  background: #1e40af;
}

/* ====== НИЖНИЕ КНОПКИ — ПРАВЫЙ НИЖНИЙ УГОЛ ====== */
.g2-bottom-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 30px;
  margin-bottom: 20px;
}

a.g2-nav-btn {
  display: inline-block !important;
  padding: 10px 20px !important;
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 15px !important;
}

a.g2-nav-btn:hover {
  background: #1e40af !important;
}

.galaxy-share-window {
  display: none;
  background: white;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 10px;
  margin-top: 10px;
}

.galaxy-share-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.galaxy-share-item {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #f3f4f6;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.galaxy-share-item:hover {
  background: #e5e7eb;
}

/* ADMIN BUTTONS WRAPPER */
.g2-admin-buttons {
  margin: 15px 0;
  text-align: left;
  display: flex;
  gap: 10px;
}

/* BASE BUTTON STYLE */
.g2-admin-btn {
  display: inline-block;
  background-color: #6A5ACD; /* премиальный фиолетовый */
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

/* HOVER */
.g2-admin-btn:hover {
  background-color: #5949B0;
}

/* OPTIONAL: сделать Sponsors чуть ярче */
.g2-sponsors-btn {
  background-color: #7B68EE;
}

.g2-sponsors-btn:hover {
  background-color: #6756C7;
}

/* Add Specialist form layout fix */
#g2-container, .g2-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

#sponsor-form label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
}

#sponsor-form input,
#sponsor-form select,
#sponsor-form textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

#sponsor-form button {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: #0073aa;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

#sponsor-form button:hover {
  background: #005f8d;
}

/* Force logo size in specialists catalog */
.galaxy2-card-logo {
  height: 600px !important;
}

.galaxy2-card-logo img {
  height: 100% !important;
  width: 100% !important;
  object-fit: contain !important;
}

/* ============================
   GALAXY2 AUTH MODAL (GUEST)
   ============================ */

   .g2c-auth-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
  }
  
  .g2c-auth-modal-content {
    background: #fff;
    max-width: 380px;
    width: 90%;
    margin: 120px auto;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    animation: g2cFadeIn 0.25s ease-out;
  }
  
  .g2c-auth-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .g2c-auth-btn {
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: block;
  }
  
  .g2c-auth-btn.join {
    background: #007bff;
    color: #fff;
  }
  
  .g2c-auth-btn.login {
    background: #f1f1f1;
    color: #333;
  }
  
  .g2c-auth-close {
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 22px;
    cursor: pointer;
  }
  
  @keyframes g2cFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ============================
   GALAXY2 BOTTOM SHEET
   ============================ */

.g2bs-overlay {
  position: fixed;
  left: 0; right: 0; bottom: 0; top: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  justify-content: flex-end;
  z-index: 999999;
}

.g2bs-sheet {
  width: 100%;
  max-height: 60vh; /* ограничиваем высоту */
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 16px;
  animation: g2bs-slide-up 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25); /* красивая тень */
}

@media (max-width: 768px) {
  .g2bs-sheet {
      max-height: 75vh; /* мобильная высота */
  }
}


.g2bs-handle {
  width: 42px;
  height: 5px;
  background: #ccc;
  border-radius: 3px;
  margin: 0 auto 12px auto;
}

.g2bs-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.g2bs-content {
  overflow-y: auto;
  flex: 1;
}

.g2bs-close {
  width: 100%;
  padding: 14px;
  background: #f2f2f2;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  margin-top: 12px;
  color: #222 !important;
}

@keyframes g2bs-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.g2bs-share-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g2bs-share-item {
  padding: 14px;
  background: #f7f7f7;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  text-align: left;
}

.g2bs-share-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g2bs-share-item {
  padding: 14px;
  background: #f7f7f7;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  text-align: left;
  color: #333; /* тёмный текст */
  cursor: pointer;
}

#processingModal .processing-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9998;
}

#processingModal .processing-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 25px 35px;
  border-radius: 10px;
  font-size: 18px;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.g2c-modal-close {
  background: #000000 !important; /* чёрный фон */
  color: #ffffff !important;      /* белый крестик */
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding: 0 !important;
  cursor: pointer;
  opacity: 1 !important;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  border: none !important;
}

/* Fix: normalize emoji/sticker size inside post text */
.galaxy2-feed-item .galaxy2-content img {
  width: 1.2em !important;
  height: 1.2em !important;
  display: inline-block !important;
  vertical-align: middle;
}

.g2-fb-card {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  margin-top: 14px;
  transition: transform .15s ease;
}

.g2-fb-card:hover {
  transform: scale(1.01);
}

.g2-fb-card-thumb {
  width: 100%;
  padding-top: 56.25%;
  background-size: cover;
  background-position: center;
}

.g2-fb-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15), rgba(0,0,0,0.45));
  transition: background .2s ease;
}

.g2-fb-card:hover .g2-fb-card-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.55));
}

.g2-fb-card-play {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  mask: url("data:image/svg+xml;utf8,<svg fill='black' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><polygon points='8,5 19,12 8,19'/></svg>") center/60% no-repeat;
}

.g2-fb-card-label {
  margin-top: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  opacity: 0.95;
}

/* === Galaxy2 Comments Modal — FB-style scroll === */

.g2c-modal-inner {
  max-height: 90vh;                 /* окно не выше экрана */
  width: min(480px, 100% - 32px);
  display: flex;
  flex-direction: column;           /* сверху заголовок, ниже контент, внизу форма */
}

/* список комментариев — крутится внутри модалки */
#g2c-comments-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 12px;
}

/* форма комментария — всегда внизу модалки */
#g2c-comments-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

#g2c-comments-form .galaxy2-comment-input {
  flex: 1;
}

.galaxy2-comment-send {
  white-space: nowrap;
}

/* ⭐ Comment actions (Like / Reply / Report) */
.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  padding-left: 2px;
}

.comment-actions button {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: #65676B;
  cursor: pointer;
}

.comment-actions button:hover {
  color: #1877F2;
}

