/* Стили для свайп-ленты «Инсайты дня» (бывший Астро-Свайп) */
.swipe-deck-wrapper {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: relative;
}

/* Колода имеет ограниченную высоту и собственный stacking context:
   карты стопки никогда не перекрывают кнопки действий. */
.swipe-deck {
  width: 100%;
  height: clamp(340px, calc(100dvh - 420px), 540px);
  position: relative;
  perspective: 1000px;
  isolation: isolate;
  flex: 0 0 auto;
  /* запас снизу под «хвостик» стопки (нижние карты выглядывают на 8–16px) */
  margin-bottom: 22px;
}

.swipe-card {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: #0f0d1a; /* полностью непрозрачный фон */
  color: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: var(--glow), 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  transform-origin: center bottom;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.15), opacity 0.5s ease;
}

/* Нижние карты стопки: только «край» без содержимого — текст сквозь активную карту не виден */
.swipe-card.swipe-card-back {
  opacity: 1;
  pointer-events: none;
  cursor: default;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.swipe-card.swipe-card-back > * {
  visibility: hidden;
}

.swipe-card.dragging {
  cursor: grabbing;
  transition: none !important;
}

.swipe-card-tag {
  align-self: flex-start;
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Контент карты — прокручиваемая область, если текст длинный */
.swipe-card-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 8px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.swipe-card-content > :first-child { margin-top: auto; }
.swipe-card-content > :last-child { margin-bottom: auto; }

.swipe-card-icon {
  flex: 0 0 auto;
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.15));
}

.swipe-card-text {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.5;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.swipe-card-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  font-size: 0.72rem;
  color: var(--muted);
}

.swipe-card-author {
  font-weight: 700;
  color: var(--gold);
}

/* Накладываемые бейджи Like/Nope во время перетаскивания */
.card-badge {
  position: absolute;
  top: 30px;
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 12px;
  opacity: 0;
  transform: rotate(-15deg);
  z-index: 10;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.card-badge-like {
  right: 30px;
  border: 4px solid var(--green);
  color: var(--green);
  transform: rotate(15deg);
}

.card-badge-nope {
  left: 30px;
  border: 4px solid var(--pink);
  color: var(--pink);
}

/* Кнопки управления свайпом: всегда под колодой, в нормальном потоке */
.swipe-actions {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  padding: 4px 0 2px;
}

.btn-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-circle:hover {
  transform: scale(1.1);
  border-color: var(--border-glow);
  box-shadow: var(--glow);
}

.btn-circle:active {
  transform: scale(0.95);
}

.btn-dislike { color: var(--pink); }
.btn-like { color: var(--green); }
.btn-info { color: var(--gold); }

@media (max-width: 480px) {
  .swipe-deck {
    height: clamp(320px, calc(100dvh - 370px), 520px);
  }
  .swipe-card-text { font-size: 0.98rem; }
}
