/* Nexus — Tebex theme (upload as theme asset + reference in Appearance) */

:root {
  --nx-bg: #0b0f14;
  --nx-surface: #121922;
  --nx-elevated: #1a2330;
  --nx-border: rgba(255, 255, 255, 0.08);
  --nx-text: #e8edf4;
  --nx-muted: #8b98a8;
  --nx-accent: #5eead4;
  --nx-accent-2: #a78bfa;
  --nx-danger: #f87171;
  --nx-radius: 14px;
  --nx-font: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.nexus-store {
  margin: 0;
  min-height: 100vh;
  font-family: var(--nx-font);
  color: var(--nx-text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(94, 234, 212, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(167, 139, 250, 0.14), transparent 50%),
    var(--nx-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--nx-accent);
  text-decoration: none;
}
a:hover {
  color: #99f6e4;
}

.nx-container {
  width: min(1160px, 100% - 2rem);
  margin-inline: auto;
}

.nx-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 20, 0.72);
  border-bottom: 1px solid var(--nx-border);
}

.nx-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.nx-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--nx-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nx-brand img {
  height: 40px;
  width: auto;
  border-radius: 10px;
}

.nx-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}
.nx-nav a {
  color: var(--nx-muted);
  font-size: 0.92rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}
.nx-nav a:hover {
  color: var(--nx-text);
  background: rgba(255, 255, 255, 0.04);
}

.nx-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.nx-btn:active {
  transform: scale(0.98);
}

.nx-btn-primary {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.22), rgba(167, 139, 250, 0.22));
  border-color: rgba(94, 234, 212, 0.35);
  color: var(--nx-text);
}
.nx-btn-primary:hover {
  border-color: rgba(94, 234, 212, 0.55);
  color: #fff;
}

.nx-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--nx-border);
  color: var(--nx-text);
}
.nx-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nx-alert {
  border-radius: var(--nx-radius);
  padding: 0.85rem 1rem;
  margin: 1rem auto;
  width: min(1160px, 100% - 2rem);
  border: 1px solid var(--nx-border);
  background: var(--nx-elevated);
}

.nx-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 2rem 0 4rem;
  align-items: start;
}

@media (max-width: 960px) {
  .nx-layout {
    grid-template-columns: 1fr;
  }
}

/* Let the main column participate in grid/flex correctly (prevents one long column). */
.nx-main {
  min-width: 0;
}

.nx-category-intro {
  padding: 1rem 1.15rem;
  border-radius: var(--nx-radius);
  border: 1px solid var(--nx-border);
  background: rgba(0, 0, 0, 0.2);
}

.nx-panel {
  background: linear-gradient(180deg, var(--nx-surface), rgba(18, 25, 34, 0.92));
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  overflow: hidden;
}

.nx-panel-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--nx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nx-panel-header h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.nx-panel-body {
  padding: 1.25rem;
}

.nx-sidebar .nx-panel + .nx-panel {
  margin-top: 1rem;
}

.nx-side-title {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nx-muted);
}

.nx-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nx-side-list a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  color: var(--nx-muted);
}
.nx-side-list a:hover,
.nx-side-list a.is-active {
  color: var(--nx-text);
  background: rgba(255, 255, 255, 0.05);
}

.nx-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nx-user-card img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.nx-modules {
  font-size: 0.92rem;
  color: var(--nx-muted);
}
.nx-modules .nx-module {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--nx-border);
}
.nx-modules .nx-module:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.nx-prose {
  line-height: 1.65;
  color: var(--nx-muted);
}
.nx-prose h1,
.nx-prose h2,
.nx-prose h3 {
  color: var(--nx-text);
}

/* Tebex/CMS descriptions often render as default (black) text — invisible on dark theme */
.nx-package-html {
  line-height: 1.65;
  font-size: 0.95rem;
}
.nx-package-html,
.nx-package-html p,
.nx-package-html li,
.nx-package-html span,
.nx-package-html div,
.nx-package-html td,
.nx-package-html th {
  color: #b9c5d3 !important;
}
.nx-package-html h1,
.nx-package-html h2,
.nx-package-html h3,
.nx-package-html h4,
.nx-package-html h5,
.nx-package-html h6,
.nx-package-html strong {
  color: var(--nx-text) !important;
}
.nx-package-html a {
  color: var(--nx-accent) !important;
}
.nx-package-html a:hover {
  color: #99f6e4 !important;
}
.nx-package-html ul,
.nx-package-html ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.nx-package-html img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Package listing: multi-column blocks (not a single vertical stack). */
.nx-package-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* “List” mode: several row-style cards per row on wide screens */
.nx-package-grid--rows {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

@media (min-width: 1100px) {
  .nx-package-grid:not(.nx-package-grid--rows) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.nx-package {
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  background: linear-gradient(165deg, rgba(26, 35, 48, 0.98), rgba(18, 25, 34, 0.95));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.nx-package:hover {
  border-color: rgba(94, 234, 212, 0.4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

/* Horizontal card (list-style categories) */
.nx-package--row {
  flex-direction: row;
  align-items: stretch;
  min-height: 0;
}
.nx-package--row:hover {
  transform: none;
}

@media (max-width: 480px) {
  .nx-package--row {
    flex-direction: column;
  }
  .nx-package--row .nx-package-media {
    width: 100%;
    min-height: 140px;
  }
}

.nx-package-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, rgba(94, 234, 212, 0.06), rgba(167, 139, 250, 0.06));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nx-package--row .nx-package-media {
  width: 118px;
  min-height: 112px;
  aspect-ratio: auto;
}
.nx-package-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nx-package-media--empty {
  color: var(--nx-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.75rem;
  line-height: 1.35;
}

.nx-package-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.nx-package--row .nx-package-body {
  padding: 0.9rem 1rem;
  justify-content: center;
}

/* Single package page: two clear blocks side by side */
.nx-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 767.98px) {
  .nx-detail-grid {
    grid-template-columns: 1fr;
  }
}

.nx-detail-card {
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  background: linear-gradient(165deg, rgba(26, 35, 48, 0.95), rgba(18, 25, 34, 0.92));
  overflow: hidden;
}

.nx-detail-card--media {
  padding: 0;
  aspect-ratio: 1 / 1;
  max-height: 420px;
  background: linear-gradient(145deg, rgba(94, 234, 212, 0.08), rgba(167, 139, 250, 0.06));
}

@media (max-width: 767.98px) {
  .nx-detail-card--media {
    max-height: 280px;
    aspect-ratio: 16 / 10;
  }
}

.nx-detail-card--media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nx-detail-card--body {
  padding: 1.15rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nx-detail-buy {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--nx-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.nx-detail-desc {
  margin: 0;
}

.nx-package-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--nx-text);
}

.nx-price {
  font-weight: 700;
  color: var(--nx-text);
}
.nx-price del {
  color: var(--nx-danger);
  font-weight: 600;
  margin-right: 0.35rem;
  font-size: 0.9em;
}

.nx-package-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.nx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.nx-table th,
.nx-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--nx-border);
  text-align: left;
  vertical-align: middle;
}
.nx-table th {
  color: var(--nx-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nx-footer {
  border-top: 1px solid var(--nx-border);
  padding: 2rem 0;
  color: var(--nx-muted);
  font-size: 0.88rem;
}
.nx-footer a {
  color: var(--nx-muted);
}
.nx-footer a:hover {
  color: var(--nx-accent);
}

.nx-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.nx-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.nx-qty input {
  width: 3rem;
  text-align: center;
  padding: 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--nx-border);
  background: var(--nx-bg);
  color: var(--nx-text);
}

.form-control,
.form-select {
  background: var(--nx-bg) !important;
  border: 1px solid var(--nx-border) !important;
  color: var(--nx-text) !important;
  border-radius: 10px !important;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(94, 234, 212, 0.2) !important;
  border-color: rgba(94, 234, 212, 0.45) !important;
}

.btn-primary {
  --bs-btn-bg: rgba(94, 234, 212, 0.22);
  --bs-btn-border-color: rgba(94, 234, 212, 0.45);
  --bs-btn-hover-bg: rgba(94, 234, 212, 0.32);
  --bs-btn-hover-border-color: rgba(94, 234, 212, 0.6);
  --bs-btn-color: #f8fafc;
  --bs-btn-hover-color: #fff;
}

.btn-outline-secondary {
  --bs-btn-color: var(--nx-muted);
  --bs-btn-border-color: var(--nx-border);
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.06);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.12);
  --bs-btn-hover-color: var(--nx-text);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--nx-text);
  --bs-table-border-color: var(--nx-border);
}
