/* CS-inspired premium dark theme overrides for Zeina (phpBB) */

body.zn-theme-cs {
  --zn-bg: #05070b;
  --zn-bg-2: #090d14;
  --zn-surface: rgba(11, 15, 20, 0.92);
  --zn-surface-2: rgba(15, 22, 32, 0.88);
  --zn-border: rgba(255, 255, 255, 0.09);
  --zn-border-2: rgba(255, 255, 255, 0.14);
  --zn-text: #e8edf2;
  --zn-muted: #a0abb8;
  --zn-accent-rgb: 255, 160, 0;
  --zn-accent-2-rgb: 255, 78, 0;

  --color-primary: var(--zn-accent-rgb);
  --color-text: var(--zn-accent-rgb);
  --color-secondary: 156, 166, 180;
  --panel-bg: linear-gradient(
    90deg,
    rgba(var(--zn-accent-rgb), 0.96),
    rgba(var(--zn-accent-2-rgb), 0.96)
  );

  color: var(--zn-text);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E")
      0 0/140px 140px repeat,
    radial-gradient(1100px 680px at 18% -10%, rgba(var(--zn-accent-rgb), 0.18), rgba(0, 0, 0, 0) 55%),
    radial-gradient(900px 520px at 92% 12%, rgba(92, 167, 255, 0.12), rgba(0, 0, 0, 0) 52%),
    linear-gradient(180deg, var(--zn-bg-2), var(--zn-bg));
}

body.zn-theme-cs ::selection {
  background: rgba(var(--zn-accent-rgb), 0.28);
}

body.zn-theme-cs .layout-container.max-w-6xl {
  max-width: 92rem;
}

@media (min-width: 1600px) {
  body.zn-theme-cs .layout-container.max-w-6xl {
    max-width: 104rem;
  }
}

/* Index layout: main + right sidebar */
body.zn-theme-cs .zn-index-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 1024px) {
  body.zn-theme-cs .zn-index-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
  body.zn-theme-cs .zn-index-aside {
    position: sticky;
    top: 90px;
  }
}

body.zn-theme-cs .zn-index-main,
body.zn-theme-cs .zn-index-aside {
  min-width: 0;
}

body.zn-theme-cs .zn-index-injections {
  margin-top: 0.75rem;
}

body.zn-theme-cs .zn-mchat-wrap {
  margin-top: 0.75rem;
}

body.zn-theme-cs .zn-mchat-wrap:empty {
  display: none;
}

body.zn-theme-cs .zn-mchat-embed.hidden {
  display: none;
}

body.zn-theme-cs .zn-mchat-embed .zn-mchat-title {
  margin-bottom: 0.6rem;
}

body.zn-theme-cs .zn-mchat-frame {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(15, 22, 32, 0.88), rgba(11, 15, 20, 0.92));
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
}

body.zn-theme-cs .zn-mchat-iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
  background: transparent;
}

/* Sidebar widgets */
body.zn-theme-cs .zn-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body.zn-theme-cs .zn-widget .zn-widget-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.zn-theme-cs .zn-widget-title h3 {
  font-size: 0.95rem;
  line-height: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.zn-theme-cs .zn-widget-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

body.zn-theme-cs .zn-widget-link:hover {
  border-color: rgba(var(--zn-accent-rgb), 0.28);
  background: rgba(var(--zn-accent-rgb), 0.08);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

body.zn-theme-cs .zn-widget-link-text {
  font-weight: 650;
}

/* Accent switcher */
body.zn-theme-cs .zn-accent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

body.zn-theme-cs .zn-accent {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--zn-text);
  font-weight: 650;
  font-size: 0.9rem;
  line-height: 1.1rem;
}

body.zn-theme-cs .zn-accent:hover {
  background: rgba(var(--zn-accent-rgb), 0.08);
  border-color: rgba(var(--zn-accent-rgb), 0.22);
}

body.zn-theme-cs .zn-accent.is-active {
  border-color: rgba(var(--zn-accent-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--zn-accent-rgb), 0.16), 0 14px 45px rgba(0, 0, 0, 0.55);
}

body.zn-theme-cs .zn-accent-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 9999px;
  background: rgb(var(--zn-dot));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 22px rgba(var(--zn-dot), 0.35);
}

body.zn-theme-cs .zn-accent-reset {
  width: 100%;
  border-radius: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(160, 171, 184, 0.9);
  font-weight: 650;
}

body.zn-theme-cs .zn-accent-reset:hover {
  border-color: rgba(var(--zn-accent-rgb), 0.26);
  color: var(--zn-text);
}

/* Stats cards */
body.zn-theme-cs .zn-stats-cards {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  body.zn-theme-cs .zn-stats-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.zn-theme-cs .zn-stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.95rem;
  padding: 1rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(15, 22, 32, 0.88), rgba(11, 15, 20, 0.92));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
}

body.zn-theme-cs .zn-stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 180px at 18% 10%, rgba(var(--zn-accent-rgb), 0.16), rgba(0, 0, 0, 0) 60%),
    radial-gradient(380px 170px at 92% 22%, rgba(92, 167, 255, 0.12), rgba(0, 0, 0, 0) 62%);
  pointer-events: none;
}

body.zn-theme-cs .zn-stat-card::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(var(--zn-accent-rgb), 0.15), rgba(var(--zn-accent-rgb), 0.7), rgba(92, 167, 255, 0.4));
  opacity: 0.85;
  pointer-events: none;
}

body.zn-theme-cs .zn-stat-label {
  position: relative;
  color: rgba(160, 171, 184, 0.85);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

body.zn-theme-cs .zn-stat-value {
  position: relative;
  margin-top: 0.45rem;
  font-size: 1.55rem;
  line-height: 1.8rem;
  font-weight: 800;
  color: var(--zn-text);
  text-shadow: 0 14px 45px rgba(0, 0, 0, 0.65);
}

@media (min-width: 1024px) {
  body.zn-theme-cs .zn-stat-value {
    font-size: 1.75rem;
    line-height: 2rem;
  }
}

body.zn-theme-cs .zn-stat-empty {
  color: rgba(160, 171, 184, 0.8);
}

body.zn-theme-cs .zn-stat-raw {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sponsors strip */
body.zn-theme-cs .zn-sponsors {
  padding: 0.85rem !important;
  border-radius: 1rem;
}

body.zn-theme-cs .zn-sponsors-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  body.zn-theme-cs .zn-sponsors-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  body.zn-theme-cs .zn-sponsors-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.zn-theme-cs .zn-sponsor {
  position: relative;
  overflow: hidden;
  border-radius: 0.95rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  min-height: 72px;
}

body.zn-theme-cs .zn-sponsor::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 170px at 20% 15%, rgba(var(--zn-accent-rgb), 0.18), rgba(0, 0, 0, 0) 60%);
  opacity: 0.9;
  pointer-events: none;
}

body.zn-theme-cs .zn-sponsor:hover {
  border-color: rgba(var(--zn-accent-rgb), 0.24);
  background: rgba(var(--zn-accent-rgb), 0.07);
  transform: translateY(-1px);
}

body.zn-theme-cs .zn-sponsor-mark {
  position: relative;
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

body.zn-theme-cs .zn-sponsor-sub {
  position: relative;
  margin-top: 0.25rem;
  color: rgba(160, 171, 184, 0.9);
  font-size: 0.8rem;
  font-weight: 650;
}

body.zn-theme-cs .page-body {
  background: transparent !important;
}

/* Utility remaps (Tailwind output) */
body.zn-theme-cs .bg-gray-100 {
  background-color: rgba(5, 7, 11, 0.4) !important;
}

body.zn-theme-cs .bg-white {
  background-color: var(--zn-surface) !important;
}

body.zn-theme-cs .bg-gray-50,
body.zn-theme-cs .bg-slate-50 {
  background-color: var(--zn-surface-2) !important;
}

body.zn-theme-cs .bg1,
body.zn-theme-cs .bg2 {
  background-color: transparent !important;
}

body.zn-theme-cs .text-gray-800,
body.zn-theme-cs .text-gray-700,
body.zn-theme-cs .text-gray-600 {
  color: var(--zn-text) !important;
}

body.zn-theme-cs .text-secondary,
body.zn-theme-cs .text-slate-200 {
  color: var(--zn-muted) !important;
}

body.zn-theme-cs .border,
body.zn-theme-cs .border-gray-200,
body.zn-theme-cs .border-gray-100,
body.zn-theme-cs .border-t,
body.zn-theme-cs .border-b {
  border-color: var(--zn-border) !important;
}

body.zn-theme-cs .shadow-sm {
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.55) !important;
}

body.zn-theme-cs .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--zn-border) !important;
}

body.zn-theme-cs .bg-red-50 {
  background-color: rgba(185, 28, 28, 0.12) !important;
}

body.zn-theme-cs .border-red-300 {
  border-color: rgba(185, 28, 28, 0.35) !important;
}

body.zn-theme-cs .text-red-700 {
  color: #ff8787 !important;
}

/* Navbar + breadcrumbs: sticky, glassy, tactical */
body.zn-theme-cs .navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--zn-border);
  background: rgba(7, 10, 15, 0.72) !important;
  backdrop-filter: blur(12px);
}

body.zn-theme-cs .navbar::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(var(--zn-accent-rgb), 0),
    rgba(var(--zn-accent-rgb), 0.55),
    rgba(92, 167, 255, 0.35),
    rgba(var(--zn-accent-rgb), 0)
  );
  opacity: 0.8;
  pointer-events: none;
}

body.zn-theme-cs .breadcrumbs-panel {
  background: rgba(7, 10, 15, 0.55) !important;
  backdrop-filter: blur(10px);
}

body.zn-theme-cs .dropdown {
  background-color: rgba(11, 15, 20, 0.96) !important;
  border-color: var(--zn-border) !important;
}

/* Header: darken image + add HUD overlays */
body.zn-theme-cs .header-section {
  isolation: isolate;
}

body.zn-theme-cs .header-section .header-image {
  filter: saturate(0.85) brightness(0.42) contrast(1.08);
  transform: scale(1.03);
}

body.zn-theme-cs .header-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 22% 70%, rgba(var(--zn-accent-rgb), 0.22), rgba(0, 0, 0, 0) 62%),
    radial-gradient(820px 380px at 88% 15%, rgba(92, 167, 255, 0.18), rgba(0, 0, 0, 0) 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.78));
  mix-blend-mode: normal;
  z-index: 1;
  pointer-events: none;
}

body.zn-theme-cs .header-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 1px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0) 8px
  );
  opacity: 0.16;
  animation: zn-scan 12s linear infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes zn-scan {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-120px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.zn-theme-cs .header-section::after {
    animation: none;
  }
  body.zn-theme-cs .btn-primary:hover {
    transform: none;
  }
}

body.zn-theme-cs .header-section h1,
body.zn-theme-cs .header-section p {
  text-shadow: 0 10px 35px rgba(0, 0, 0, 0.75);
}

body.zn-theme-cs .card,
body.zn-theme-cs .card-sm,
body.zn-theme-cs .panel,
body.zn-theme-cs .dropdown-item,
body.zn-theme-cs .btn-primary,
body.zn-theme-cs .btn-primary-outline {
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease,
    color 220ms ease;
}

/* Panels/cards: premium glass + accent sheen */
body.zn-theme-cs .card,
body.zn-theme-cs .card-sm,
body.zn-theme-cs .panel {
  background:
    linear-gradient(180deg, rgba(15, 22, 32, 0.88), rgba(11, 15, 20, 0.9)) !important;
  border-color: var(--zn-border) !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(var(--zn-accent-rgb), 0.06) !important;
  backdrop-filter: blur(10px);
}

/* Forum rows: more "panel" feel on hover */
body.zn-theme-cs .forum.row {
  border-radius: 0.9rem;
}

body.zn-theme-cs .forum.row:hover {
  background: rgba(255, 255, 255, 0.02);
}

body.zn-theme-cs .card,
body.zn-theme-cs .panel {
  position: relative;
  overflow: hidden;
}

body.zn-theme-cs .card::before,
body.zn-theme-cs .panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    rgba(var(--zn-accent-rgb), 0.14),
    rgba(0, 0, 0, 0) 45%,
    rgba(92, 167, 255, 0.10)
  );
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

body.zn-theme-cs .card:hover::before,
body.zn-theme-cs .panel:hover::before {
  opacity: 1;
}

body.zn-theme-cs .card-title {
  position: relative;
  overflow: hidden;
  border-color: var(--zn-border) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.zn-theme-cs .card-title::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(180deg, rgba(var(--zn-accent-rgb), 0.95), rgba(92, 167, 255, 0.55));
  opacity: 0.9;
}

body.zn-theme-cs .zn-category-title h2 {
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.zn-theme-cs .zn-category-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
}

/* Forum icon polish */
body.zn-theme-cs .forum_icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

body.zn-theme-cs .forum_icon .iconify {
  margin-top: 0 !important;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55));
}

/* mChat integration (best-effort selectors) */
body.zn-theme-cs [id^="mchat"],
body.zn-theme-cs .mchat {
  color: var(--zn-text);
}

body.zn-theme-cs #mchat,
body.zn-theme-cs .mchat {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(15, 22, 32, 0.88), rgba(11, 15, 20, 0.92));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

body.zn-theme-cs #mchat-header,
body.zn-theme-cs .mchat-header {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.zn-theme-cs #mchat-header *,
body.zn-theme-cs .mchat-header * {
  color: var(--zn-text) !important;
}

body.zn-theme-cs #mchat-content,
body.zn-theme-cs #mchat-body,
body.zn-theme-cs .mchat-body,
body.zn-theme-cs .mchat-content {
  background: transparent !important;
}

body.zn-theme-cs #mchat-messages,
body.zn-theme-cs .mchat-messages {
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.zn-theme-cs #mchat-input,
body.zn-theme-cs .mchat-input,
body.zn-theme-cs #mchat-input input,
body.zn-theme-cs .mchat-input input,
body.zn-theme-cs #mchat-input textarea,
body.zn-theme-cs .mchat-input textarea {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: var(--zn-text) !important;
  border-radius: 0.85rem !important;
}

body.zn-theme-cs #mchat-input button,
body.zn-theme-cs .mchat-input button,
body.zn-theme-cs #mchat-submit,
body.zn-theme-cs .mchat-submit {
  border-radius: 0.85rem !important;
  border: 1px solid rgba(var(--zn-accent-rgb), 0.45) !important;
  background: rgba(var(--zn-accent-rgb), 0.14) !important;
  color: var(--zn-text) !important;
}

body.zn-theme-cs #mchat-input button:hover,
body.zn-theme-cs .mchat-input button:hover,
body.zn-theme-cs #mchat-submit:hover,
body.zn-theme-cs .mchat-submit:hover {
  background: rgba(var(--zn-accent-rgb), 0.22) !important;
}

/* Inputs */
body.zn-theme-cs .inputbox,
body.zn-theme-cs select,
body.zn-theme-cs textarea {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: var(--zn-text) !important;
  --tw-ring-color: rgba(var(--zn-accent-rgb), 0.35) !important;
}

body.zn-theme-cs input::placeholder,
body.zn-theme-cs textarea::placeholder {
  color: rgba(160, 171, 184, 0.7) !important;
}

/* Buttons */
body.zn-theme-cs .btn-primary {
  border-color: rgba(var(--zn-accent-rgb), 0.55) !important;
  background: linear-gradient(
    135deg,
    rgba(var(--zn-accent-rgb), 0.98),
    rgba(var(--zn-accent-2-rgb), 0.98)
  ) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(var(--zn-accent-rgb), 0.12) !important;
}

body.zn-theme-cs .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(var(--zn-accent-rgb), 0.18) !important;
}

body.zn-theme-cs .btn-primary-outline {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--zn-text) !important;
}

body.zn-theme-cs .btn-primary-outline:hover {
  background: rgba(var(--zn-accent-rgb), 0.10) !important;
  border-color: rgba(var(--zn-accent-rgb), 0.22) !important;
}

/* Quotes + content blocks */
body.zn-theme-cs blockquote {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(var(--zn-accent-rgb), 0.25) !important;
}

body.zn-theme-cs blockquote cite {
  border-color: var(--zn-border) !important;
}

/* Scrollbar */
body.zn-theme-cs *::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
body.zn-theme-cs *::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(var(--zn-accent-rgb), 0.32),
    rgba(92, 167, 255, 0.22)
  );
  border-radius: 9999px;
  border: 3px solid rgba(7, 10, 15, 0.8);
}
body.zn-theme-cs *::-webkit-scrollbar-track {
  background: rgba(7, 10, 15, 0.65);
}
