/* ==========================================================================
   Tambahan di atas shared.css + home.css (desain demo):
   elemen khusus situs (logo, akun, flash sale, berita) dan penyesuaian
   halaman lama (order, invoice, riwayat, dashboard) ke palet gelap-ungu.
   ========================================================================== */

:root {
  --text-color: linear-gradient(to right, #a89aff, #8c79ff);
  --background-color: linear-gradient(135deg, #8c79ff, #725cf4);
  --border-color: #8c79ff;
}

/* ------------------------------ Header tambahan ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
}

.brand-logo {
  height: 34px;
  width: auto;
  max-width: 44px;
  border-radius: 9px;
  object-fit: contain;
}

.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.brand-search-row.is-auth {
  grid-template-columns: 190px minmax(280px, 1fr) auto 42px;
}

.balance-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--accent-soft);
  line-height: 1.2;
}

.balance-chip small {
  color: var(--muted);
  font-size: 8px;
}

.balance-chip b {
  color: #d9d2ff;
  font-size: 11px;
}

.account-menu {
  position: relative;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, .025);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.account-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(145deg, #917efc, #624fe2);
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: 220px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #20202b;
  box-shadow: var(--shadow);
}

.account-dropdown[hidden] {
  display: none;
}

.account-dropdown-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
}

.account-dropdown-head b {
  display: block;
  font-size: 12px;
}

.account-dropdown-head small {
  color: #c6baff;
  font-size: 10px;
}

.account-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #d5d3e0;
  font-size: 11px;
  font-weight: 700;
}

.account-dropdown a i {
  width: 14px;
  color: var(--dim);
}

.account-dropdown a:hover {
  background: #2b2939;
  color: #fff;
}

.account-dropdown a.logout {
  border-top: 1px solid var(--border);
  color: var(--red);
}

.trend-row .trend-skeleton {
  width: 70px;
  height: 9px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
}

@media (max-width: 700px) {
  .brand-name,
  .balance-chip,
  .account-trigger .account-name {
    display: none;
  }

  .brand-search-row.is-auth {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}

/* ------------------------------ Hero dari data game ------------------------------ */
.hero-card.is-skeleton {
  background: linear-gradient(90deg, #1b1b26 25%, #222230 37%, #1b1b26 63%);
  background-size: 400% 100%;
  animation: gh-shimmer 1.3s ease infinite;
}

.product-card.is-skeleton {
  aspect-ratio: .8 / 1;
  background: linear-gradient(90deg, #1b1b26 25%, #222230 37%, #1b1b26 63%);
  background-size: 400% 100%;
  animation: gh-shimmer 1.3s ease infinite;
}

@keyframes gh-shimmer {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

/* ------------------------------ Flash sale ------------------------------ */
.flash-section {
  padding: 26px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, .045);
}

.flash-section[hidden] {
  display: none;
}

.flash-timer {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
}

.flash-timer .time {
  min-width: 30px;
  padding: 5px 6px;
  border: 1px solid rgba(243, 191, 105, .3);
  border-radius: 7px;
  background: rgba(243, 191, 105, .1);
  color: var(--amber);
  text-align: center;
}

.flash-timer .separator {
  color: var(--dim);
}

.flash-row {
  display: grid;
  grid-auto-columns: 180px; /* lebar tetap: 1 produk tidak melebar memenuhi layar */
  grid-auto-flow: column;
  gap: 11px;
  overflow-x: auto;
  scrollbar-width: none;
}

.flash-row::-webkit-scrollbar {
  display: none;
}

.product-badge.badge-discount {
  border-color: rgba(240, 130, 142, .4);
  background: rgba(240, 130, 142, .9);
  color: #fff;
}

.product-price {
  margin-top: 2px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
}

.product-price-old {
  color: var(--dim);
  font-size: 8px;
  text-decoration: line-through;
}

/* ------------------------------ Berita ------------------------------ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.news-grid .product-image {
  aspect-ratio: 16 / 9;
}

@media (max-width: 700px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .flash-row {
    grid-auto-columns: 42%;
    gap: 7px;
  }
}

/* ------------------------------ Footer tambahan ------------------------------ */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}

.footer-links a:hover {
  color: #c6baff;
}

@media (max-width: 700px) {
  .footer-links {
    margin-left: 0;
    order: 3;
    flex-basis: 100%;
    gap: 12px;
  }
}

/* ------------------------------ Popup ------------------------------ */
#backdrop {
  z-index: 95;
  backdrop-filter: blur(6px);
}

#static-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  transform: translate(-50%, -50%);
}

.popup-card {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  font-weight: 800;
}

/* ==========================================================================
   Halaman lama: kelas gelap lama dipetakan ke palet demo
   ========================================================================== */
.content {
  min-height: 60vh;
}

/* Semua halaman selain beranda memakai lebar & posisi tengah yang sama dengan .shell */
.page-shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
  padding: 24px 0 40px;
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 28px, var(--shell));
    padding-top: 16px;
  }
}

@media (max-width: 380px) {
  .page-shell {
    width: calc(100% - 22px);
  }
}

/* Wrapper bawaan halaman lama: buang padding samping & batas lebar agar tepinya sejajar header */
.page-shell > section,
.page-shell > div:not(.max-w-screen-md),
.page-shell > section > div,
.page-shell > div:not(.max-w-screen-md) > div:first-child {
  max-width: none !important;
}

.page-shell > section,
.page-shell > div,
.page-shell > section > div,
.page-shell > div > div,
.page-shell .sticky-content > .px-3 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.page-shell > section,
.page-shell > section > div {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Form login/daftar dll. dulu dipaksa setinggi layar */
.page-shell .md\:h-screen {
  height: auto !important;
  min-height: 0 !important;
}

.page-shell > section > div.lg\:py-16 {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.bg-murky-900 {
  background-color: var(--bg) !important;
}

.bg-murky-800,
.bg-title-product {
  background-color: var(--panel) !important;
  background-image: none !important;
}

.content .bg-murky-800 {
  border: 1px solid var(--border);
}

.bg-murky-700 {
  background-color: var(--panel-raised) !important;
}

.bg-murky-600 {
  background-color: var(--panel-hover) !important;
}

.bg-murky-300 {
  background-color: var(--bg-soft) !important;
}

.border-murky-800,
.border-murky-800\/75,
.border-murky-600 {
  border-color: var(--border) !important;
}

.content .text-gray-300,
.content .text-gray-400,
.content .text-gray-500 {
  color: var(--muted) !important;
}

.x-bg-g,
.x-btn-g {
  background: var(--accent-strong) !important;
  background-image: none !important;
  color: #fff;
}

.x-bg-g:hover,
.x-btn-g:hover {
  background: #806bf8 !important;
}

.x-color-g {
  background: none !important;
  -webkit-text-fill-color: #b4a8ff !important;
  color: #b4a8ff !important;
}

.x-border {
  border-color: var(--accent) !important;
}

.custom-input {
  border: 1px solid var(--border-strong) !important;
  border-radius: 9px !important;
  background-color: var(--panel-raised) !important;
  color: var(--ink) !important;
  padding: 8px 12px !important;
}

.custom-input::placeholder {
  color: #818093;
}

.custom-input:focus {
  border-color: rgba(157, 140, 255, .66) !important;
  box-shadow: 0 0 0 3px rgba(126, 103, 240, .12) !important;
}

/* Pilihan nominal & metode bayar (order): bg-gray-300 = belum dipilih, bg-white = dipilih */
.content [id^="productBtn"],
.content [id^="metodeBtn"] {
  border: 1px solid var(--border) !important;
  background-color: var(--panel-raised) !important;
  color: var(--ink) !important;
  transition: border-color .15s, background .15s;
}

.content [id^="productBtn"]:hover,
.content [id^="metodeBtn"]:hover {
  border-color: rgba(178, 160, 255, .35) !important;
}

.content [id^="productBtn"].bg-white,
.content [id^="metodeBtn"].bg-white {
  border-color: var(--accent) !important;
  background-color: rgba(119, 98, 241, .2) !important;
}

.content [id^="productBtn"] .text-gray-900,
.content [id^="metodeBtn"] .text-gray-900,
.content [id^="productBtn"].text-gray-900,
.content [id^="metodeBtn"].text-gray-900 {
  color: var(--ink) !important;
}

.content table {
  color: var(--ink);
}

.content thead,
.content table th {
  background-color: var(--panel-raised) !important;
  color: var(--ink) !important;
}

.content table td {
  border-color: var(--border) !important;
}

.my-custom-alert {
  background-color: var(--panel-raised) !important;
  color: var(--ink) !important;
}

.progress-container {
  background-color: var(--panel) !important;
  border: 1px solid var(--border);
}

.step-icon.pending {
  background-color: #3a3a4a !important;
}

/* SweetAlert dalam tema gelap (dialog konfirmasi, mis. generate API key) */
.swal2-popup {
  border: 1px solid var(--border-strong);
  border-radius: 14px !important;
}

.swal2-input {
  border: 1px solid var(--border-strong) !important;
  border-radius: 9px !important;
  background: var(--panel-raised) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.swal2-input:focus {
  border-color: rgba(157, 140, 255, .66) !important;
  box-shadow: 0 0 0 3px rgba(126, 103, 240, .12) !important;
}

.swal2-validation-message {
  background: var(--bg-soft) !important;
  color: var(--red) !important;
}
