/* =====================================================
   AGE-GATE-UNIFIED.CSS
   Единые стили 18+, пульсация чата, hover иконок меню
   ===================================================== */

/* ===== ЗАДАЧА 1: Единый вид кнопок 18+ ===== */

/* БАЗОВОЕ ЦЕНТРИРОВАНИЕ ТЕКСТА В КНОПКАХ (все режимы) */
.ssx-card .ssx-ageBtn,
.pc-ageGate__btn,
.related-ageGate__btn,
.inf-ageGate__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Fullstory кнопки — вид как в shortstory */
.pc-ageGate__btn {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .02em;
  line-height: 1;
  transition: opacity .2s ease, transform .15s ease;
}
.pc-ageGate__btn:hover { opacity: .9; }
.pc-ageGate__btn:active { transform: translateY(1px); }
.pc-ageGate__btn--yes { background: #22c55e; color: #062312; }
.pc-ageGate__btn--no { background: #ef4444; color: #fff; }
.pc-ageGate__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.pc-ageGate__title {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-weight: 1000;
  font-size: 18px;
  line-height: 1;
}

/* ===== ЗАДАЧА 1b: Адаптация для card/grid2 режимов shortstory ===== */

/* Режим card — постер вертикальный на всю ширину */
[data-view-mode="card"] .ssx-card .ssx-ageGate { border-radius: 10px; }
[data-view-mode="card"] .ssx-card .ssx-ageBox {
  width: calc(100% - 24px);
  padding: 16px 14px;
}
[data-view-mode="card"] .ssx-card .ssx-ageBadge { font-size: 22px; padding: 8px 14px; }
[data-view-mode="card"] .ssx-card .ssx-ageText { margin-top: 10px; font-size: 13px; }
[data-view-mode="card"] .ssx-card .ssx-ageBtns { margin-top: 12px; gap: 10px; }
[data-view-mode="card"] .ssx-card .ssx-ageBtn { min-height: 40px; font-size: 14px; border-radius: 12px; }

/* Режим grid2 — постер ~160px, компактно */
[data-view-mode="grid2"] .ssx-card .ssx-ageGate { border-radius: 10px; }
[data-view-mode="grid2"] .ssx-card .ssx-ageBox {
  width: calc(100% - 12px);
  padding: 10px 8px;
}
[data-view-mode="grid2"] .ssx-card .ssx-ageBadge { font-size: 16px; padding: 5px 9px; }
[data-view-mode="grid2"] .ssx-card .ssx-ageText { margin-top: 6px; font-size: 10px; }
[data-view-mode="grid2"] .ssx-card .ssx-ageBtns { margin-top: 8px; gap: 6px; }
[data-view-mode="grid2"] .ssx-card .ssx-ageBtn {
  min-height: 30px;
  font-size: 11px;
  border-radius: 10px;
}

/* Мобилка grid2 — ещё компактнее */
@media (max-width: 720px) {
  [data-view-mode="grid2"] .ssx-card .ssx-ageBox { padding: 8px 6px; }
  [data-view-mode="grid2"] .ssx-card .ssx-ageBadge { font-size: 14px; padding: 4px 8px; }
  [data-view-mode="grid2"] .ssx-card .ssx-ageText { margin-top: 4px; font-size: 9px; }
  [data-view-mode="grid2"] .ssx-card .ssx-ageBtns { margin-top: 6px; gap: 4px; }
  [data-view-mode="grid2"] .ssx-card .ssx-ageBtn { min-height: 26px; font-size: 10px; border-radius: 8px; }
}


/* ===== ЗАДАЧА 2a: Related News — динамический оверлей 18+ ===== */
/* Оверлей создаётся через JS для .related-news-wrap--adult */

.related-card--adult {
  position: relative;
}
/* Блокируем клик по ссылке пока оверлей активен */
.related-card--adult:not(.age-confirmed) .related-card__link {
  pointer-events: none;
}
.related-card--adult.age-confirmed .related-card__link {
  pointer-events: auto;
}
.related-card--adult:not(.age-confirmed) .related-card__overlay {
  display: none;
}

.related-ageGate {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, .85);
  backdrop-filter: blur(3px);
  border-radius: 12px;
}
.related-ageGate[aria-hidden="true"] {
  display: none;
}
.related-ageGate__box {
  text-align: center;
  padding: 10px;
}
.related-ageGate__badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-weight: 1000;
  font-size: 16px;
  line-height: 1;
}
.related-ageGate__text {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.25;
  color: rgba(255, 255, 255, .92);
}
.related-ageGate__actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.related-ageGate__btn {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .02em;
  line-height: 1;
  padding: 8px 12px;
  min-height: 30px;
  transition: opacity .2s, transform .15s;
}
.related-ageGate__btn:hover { opacity: .85; }
.related-ageGate__btn:active { transform: translateY(1px); }
.related-ageGate__btn--yes { background: #22c55e; color: #062312; }
.related-ageGate__btn--no { background: #ef4444; color: #fff; }

/* Подтверждённое состояние */
.related-card--adult.age-confirmed .related-card__poster img {
  filter: none !important;
  transform: scale(1) !important;
  transition: filter 0.3s ease, transform 0.3s ease;
}


/* ===== ЗАДАЧА 2b: Стили для информеров ===== */
.inf_item-1 { position: relative; }
.inf_item_img { position: relative; overflow: hidden; }

.inf-ageGate {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, .85);
  backdrop-filter: blur(3px);
  border-radius: 4px;
}
.inf-ageGate[aria-hidden="true"] { display: none; }
.inf-ageGate__box { text-align: center; padding: 8px; }
.inf-ageGate__badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-weight: 1000;
  font-size: 16px;
  line-height: 1;
}
.inf-ageGate__text {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.25;
  color: rgba(255, 255, 255, .92);
}
.inf-ageGate__actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.inf-ageGate__btn {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .02em;
  line-height: 1;
  padding: 8px 6px;
  min-height: 30px;
  transition: opacity .2s ease, transform .15s ease;
}
.inf-ageGate__btn:hover { opacity: .85; }
.inf-ageGate__btn:active { transform: translateY(1px); }
.inf-ageGate__btn--yes { background: #22c55e; color: #062312; }
.inf-ageGate__btn--no { background: #ef4444; color: #fff; }

.inf_item--adult .inf_item_img img {
  filter: blur(20px) brightness(.72);
  transform: scale(1.06);
}
.inf_item--adult.age-confirmed .inf_item_img img {
  filter: none !important;
  transform: scale(1) !important;
  transition: filter 0.3s ease, transform 0.3s ease;
}


/* ===== ЗАДАЧА 3: Hover-эффект для иконок меню ===== */
.main_nav .nav-link svg {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.main_nav .nav-link:hover svg {
  transform: scale(1.15);
}


/* ===== ЗАДАЧА 4: Пульсация/свечение кнопки чата ===== */
@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(73, 181, 69, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 12px rgba(73, 181, 69, 0);
  }
}

.eg-chat-toggle.swipe_effect {
  animation: pulse-glow 2.5s ease-in-out infinite;
}
.eg-chat-toggle.swipe_effect:hover {
  animation: none;
  transform: scale(1.1);
}
/* Убираем swipe_effect::before для чат-кнопки */
.eg-chat-toggle.swipe_effect::before {
  display: none;
}
/* Когда чат открыт — без пульсации */
.eg-chat-toggle--active.swipe_effect {
  animation: none;
}


/* ===== DARK THEME дополнения ===== */
[data-theme="dark"] .inf-ageGate { background: rgba(21, 23, 29, .92); }
[data-theme="dark"] .related-ageGate { background: rgba(21, 23, 29, .92); }

[data-theme="dark"] .eg-chat-toggle.swipe_effect {
  animation-name: pulse-glow-dark;
}
@keyframes pulse-glow-dark {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 0 12px rgba(34, 197, 94, 0);
  }
}


/* ===== Mobile ===== */
@media (max-width: 768px) {
  .inf-ageGate__badge { font-size: 14px; padding: 3px 8px; }
  .inf-ageGate__text { font-size: 9px; }
  .inf-ageGate__btn { font-size: 10px; padding: 6px 4px; min-height: 26px; }
  
  .related-ageGate__badge { font-size: 14px; }
  .related-ageGate__btn { font-size: 10px; padding: 6px 8px; min-height: 26px; }
}
