/* ============================================================
   PG_Widget_Social_Links — Social Links Widget Styles
   هماهنگ با طراحی گیمینگ قالب Pantigame
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.pg-sl-no-title {
  padding: 0 !important;
}

.pg-sl-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4) 0;
  text-align: center;
}

/* ── Grid Layouts ─────────────────────────────────────────── */
.pg-sl-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  direction: rtl;
}

.pg-sl-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--space-3);
}

.pg-sl-layout-row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--space-2);
}

.pg-sl-layout-col {
  flex-direction: column;
  gap: var(--space-2);
}

/* ── Icon Sizes ───────────────────────────────────────────── */
.pg-sl-size-sm .pg-sl-item { --sl-size: 36px; --sl-radius: var(--radius-md); --sl-icon: 18px; }
.pg-sl-size-md .pg-sl-item { --sl-size: 48px; --sl-radius: var(--radius-lg); --sl-icon: 24px; }
.pg-sl-size-lg .pg-sl-item { --sl-size: 64px; --sl-radius: var(--radius-xl); --sl-icon: 32px; }

/* ── Col layout: full width ───────────────────────────────── */
.pg-sl-layout-col .pg-sl-item {
  width: 100%;
  min-height: var(--sl-size, 48px);
  height: auto;
  justify-content: flex-start;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
}

/* ── Item (button) ────────────────────────────────────────── */
.pg-sl-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--sl-size, 48px);
  height: var(--sl-size, 48px);
  border-radius: var(--sl-radius, var(--radius-lg));
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--transition-bounce),
    box-shadow var(--transition-normal),
    filter var(--transition-normal);

  /* گرادیانت از متغیر رنگ */
  background: linear-gradient(
    135deg,
    var(--pg-sl-c1, var(--color-primary)) 0%,
    var(--pg-sl-c2, var(--color-info))    100%
  );

  /* سایه رنگی */
  box-shadow:
    0 4px 14px rgba(0,0,0,0.35),
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 1px 0 rgba(255,255,255,0.12) inset;
}

/* Glow لایه زیرین (pseudo) */
.pg-sl-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--pg-sl-c1, var(--color-primary)) 0%,
    var(--pg-sl-c2, var(--color-info))    100%
  );
  opacity: 0;
  filter: blur(12px);
  transition: opacity var(--transition-normal);
  z-index: -1;
  border-radius: inherit;
  transform: scale(1.3);
}

/* Shine sweep روی هاور */
.pg-sl-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255,255,255,0.18) 50%,
    transparent 80%
  );
  transform: translateX(-120%);
  transition: transform 0.5s ease;
  pointer-events: none;
}

/* ── Hover / Focus ────────────────────────────────────────── */
.pg-sl-item:hover,
.pg-sl-item:focus-visible {
  transform: translateY(-4px) scale(1.08);
  box-shadow:
    0 8px 28px color-mix(in srgb, var(--pg-sl-c1, var(--color-primary)) 55%, transparent),
    0 0 0 2px rgba(255,255,255,0.15) inset;
  filter: brightness(1.1);
  outline: none;
}

.pg-sl-item:hover::before,
.pg-sl-item:focus-visible::before {
  opacity: 0.5;
}

.pg-sl-item:hover::after {
  transform: translateX(120%);
}

/* ── Active / Click ───────────────────────────────────────── */
.pg-sl-item:active {
  transform: translateY(-1px) scale(1.02);
  transition: transform 0.1s ease;
}

/* ── آیکون SVG / IMG ──────────────────────────────────────── */
.pg-sl-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--sl-icon, 24px);
  height: var(--sl-icon, 24px);
  color: #fff;
  flex-shrink: 0;
}

.pg-sl-icon-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.pg-sl-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.pg-sl-icon-fallback {
  font-size: var(--sl-icon, 24px);
  line-height: 1;
}

/* ── برچسب زیر آیکون ─────────────────────────────────────── */
.pg-sl-label {
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  color: rgba(255,255,255,0.92);
  text-align: center;
  line-height: 1;
  margin-top: 4px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* وقتی برچسب نمایش داده می‌شه، آیتم تالرتر می‌شه */
.pg-sl-item:has(.pg-sl-label) {
  height: auto;
  min-height: var(--sl-size, 48px);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

/* ── در فوتر (داخل pg-footer) ────────────────────────────── */
.pg-footer .pg-sl-wrap,
.pg-footer-about .pg-sl-wrap {
  margin-top: var(--space-4);
}

/* در فوتر — گرید وسط‌چین */
.pg-footer .pg-sl-layout-grid {
  justify-items: center;
}

/* ── ویجت ابزارک (داخل سایدبار) ─────────────────────────── */
.pg-sidebar-widget .pg-sl-wrap {
  padding: var(--space-2) 0;
}

/* ── Pulse animation روی نشانگر فعال ─────────────────────── */
@keyframes pg-sl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pg-sl-c1) 60%, transparent); }
  50%       { box-shadow: 0 0 0 8px transparent; }
}

.pg-sl-item.pg-sl-pulse-on {
  animation: pg-sl-pulse 2s ease-in-out infinite;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .pg-sl-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  }
  .pg-sl-size-lg .pg-sl-item {
    --sl-size: 52px;
    --sl-icon: 26px;
  }
}

/* ── Light mode overrides ─────────────────────────────────── */
body.light-mode .pg-sl-item {
  box-shadow:
    0 4px 14px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.4) inset;
}

body.light-mode .pg-sl-item:hover,
body.light-mode .pg-sl-item:focus-visible {
  box-shadow:
    0 8px 28px color-mix(in srgb, var(--pg-sl-c1) 45%, transparent),
    0 0 0 2px rgba(255,255,255,0.5) inset;
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .pg-sl-item,
  .pg-sl-item::before,
  .pg-sl-item::after {
    transition: none;
    animation: none;
  }
  .pg-sl-item:hover {
    transform: none;
  }
}

/* ============================================================
   pg-social-banner — بنر جایگزین خبرنامه در فوتر
   ============================================================ */
.pg-social-banner {
  position: relative;
  padding: var(--space-10) var(--space-8);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: var(--space-10);

  /* پس‌زمینه گلاس با گرادیانت */
  background:
    linear-gradient(135deg,
      rgba(56,189,248,0.08) 0%,
      rgba(129,140,248,0.10) 50%,
      rgba(244,63,94,0.06)  100%
    ),
    var(--color-bg-2);

  border: 1px solid rgba(56,189,248,0.15);
  box-shadow:
    var(--shadow-md),
    0 0 60px rgba(56,189,248,0.06) inset;
}

/* اثر نور زیرین */
.pg-social-banner::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 200px;
  background: radial-gradient(ellipse, rgba(56,189,248,0.12), transparent 70%);
  pointer-events: none;
}

/* نوار رنگی بالایی */
.pg-social-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #f43f5e, #fbbf24, #38bdf8);
  background-size: 200% 100%;
  animation: pg-sl-rainbow 4s linear infinite;
}

@keyframes pg-sl-rainbow {
  0%   { background-position: 0%   50%; }
  100% { background-position: 200% 50%; }
}

/* محتوای داخلی — ردیف با متن و آیکون‌ها */
.pg-social-banner__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-6);
}

.pg-social-banner__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.pg-social-banner__label {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  letter-spacing: 0.02em;
}

/* وقتی ویجت در بنر باشد */
.pg-social-banner .pg-sidebar-widget {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.pg-social-banner .pg-sidebar-widget-title {
  display: none; /* عنوان داخل بنر پنهان؛ اختیاری */
}

.pg-social-banner .pg-sidebar-widget-body {
  padding: 0 !important;
}

.pg-social-banner .pg-sl-wrap {
  justify-content: center;
}

/* فالبک (بدون ویجت) */
.pg-social-banner--fallback .pg-social-banner__inner {
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.pg-social-banner--fallback .pg-sl-wrap {
  justify-content: center;
}

/* Responsive */
@media (max-width: 640px) {
  .pg-social-banner {
    padding: var(--space-6) var(--space-4);
  }
  .pg-social-banner__inner {
    flex-direction: column;
    text-align: center;
  }
  .pg-social-banner .pg-sl-wrap {
    justify-content: center;
  }
}
