/* ========== CREDITS PAGE STYLES ========== */

/* ========== BACK BUTTON ========== */
.btn-back {
  background: var(--neutral-800);
  border: none;
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-back img {
  width: 20px;
  height: 20px;
  filter: invert(1);
}

/* ========== CONTENT LAYOUT ========== */
.content-layout {
  display: flex;
  gap: 16px;
  padding: 0 16px 16px;
  min-height: 0;
}
.content-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-right: 4px;
}

/* ========== FLASH SALE BANNER ========== */
.flash-banner {
  width: 100%;
  border-radius: 40px;
  background: #CC95FF;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 2px 24px;
  flex-shrink: 0;
}
.flash-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/images/flash-texture.png') center/cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
  border-radius: 40px;
}
.flash-left {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  flex: 1;
}
.flash-label {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: #432362;
  line-height: 26px;
}
.flash-sub {
  font-size: 14px;
  font-weight: 600;
  color: #432362;
  line-height: 20px;
}
.flash-right {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #DFBCFF;
  border-radius: 40px;
  padding: 2px 2px 2px 20px;
  position: relative;
  z-index: 1;
}
.flash-right-text {
  font-size: 14px;
  font-weight: 600;
  color: #432362;
  white-space: nowrap;
  line-height: 20px;
}
.flash-timer {
  background: #432362;
  color: #DFBCFF;
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  border-radius: 28px;
  padding: 4px 20px;
  white-space: nowrap;
}

/* ========== CREDITS SECTION ========== */
.credits-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px 0;
  position: relative;
  flex-shrink: 0;
}
.credits-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 45%, rgba(67, 35, 98, 1) 0%, rgba(51, 26, 73, 0.85) 20%, rgba(34, 18, 49, 0.5) 45%, rgba(17, 9, 24, 0.2) 70%, transparent 100%);
  pointer-events: none;
}
.credits-title-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.credits-title {
  font-size: 24px;
  font-weight: 500;
}
.credits-subtitle {
  font-size: 14px;
  color: var(--neutral-400);
}
.credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-900);
  border: 1px solid var(--purple-800);
  color: var(--purple-400);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 4px;
}

/* Package grid */
.packages-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.package-card {
  width: 140px;
  border-radius: 20px;
  padding: 4px;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--neutral-800);
  border: 1px solid var(--neutral-700);
}
.package-card:hover {
  border-color: var(--neutral-600);
}
.package-card.selected {
  background: #000;
  border-color: var(--purple-400);
  box-shadow: 0 0 28px rgba(204, 149, 255, 0.7);
}
/* Inactive packages: grayscaled, muted, not clickable. */
.package-card.inactive {
  filter: grayscale(1);
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.package-card.inactive:hover {
  border-color: var(--neutral-700);
}
.package-inner {
  background: #000;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}
.package-card.selected .package-inner {
  background: var(--purple-900);
  border: 1px solid var(--purple-700);
}
.package-card:not(.selected) .package-inner {
  border: 1px solid transparent;
}

.coin-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.package-credits {
  font-size: 18px;
  font-weight: 500;
}
.package-price {
  font-size: 14px;
  color: var(--neutral-400);
}
.package-price-old {
  font-size: 12px;
  color: #FF6186;
  text-decoration: line-through;
  margin-right: 4px;
}
.package-bonus {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.bonus-gray {
  background: var(--neutral-800);
  border: 1px solid var(--neutral-700);
  color: var(--neutral-400);
}
.bonus-purple {
  background: var(--purple-900);
  border: 1px solid var(--purple-800);
  color: var(--purple-400);
}
.discount-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--green-900);
  border: 1px solid var(--green-800);
  color: var(--green-400);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Buy Credits button (main) */
.btn-buy-main {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 4px 4px 4px 20px;
  box-shadow: 0 2px 20px rgba(255, 255, 255, 0.56);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform 0.15s;
}
.btn-buy-main:hover {
  transform: scale(1.03);
}
.btn-buy-main span {
  margin-right: 12px;
}
.btn-buy-arrow {
  background: var(--purple-300);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-buy-arrow svg {
  width: 16px;
  height: 16px;
}

/* ========== FAQ SECTION ========== */
.faq-section {
  flex-shrink: 0;
  padding-bottom: 16px;
}
.faq-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--neutral-700);
  border: 1px solid var(--neutral-700);
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.faq-header-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.faq-divider {
  width: 1px;
  height: 24px;
  background: var(--neutral-600);
  flex-shrink: 0;
}
.faq-header-text {
  flex: 1;
}
.faq-header-text h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.faq-header-text p {
  font-size: 12px;
  color: var(--neutral-400);
  margin: 0;
}
.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s;
}
.faq-header.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-list {
  display: none;
  margin-top: 8px;
}
.faq-list.show {
  display: block;
}
.faq-item {
  border-bottom: 1px solid var(--neutral-700);
  will-change: height;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  user-select: none;
  transition: color 0.2s;
}
.faq-question:hover {
  color: var(--purple-300);
}
.faq-item.open .faq-question {
  color: var(--purple-400);
}
.faq-toggle {
  font-size: 20px;
  font-weight: 400;
  color: var(--neutral-400);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding-bottom: 0;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding-bottom: 16px;
}
.faq-answer-inner {
  background: var(--neutral-800);
  border: 1px solid var(--neutral-700);
  border-radius: 12px;
  padding: 16px;
  font-size: 12px;
  color: var(--neutral-400);
  line-height: 1.6;
}

/* ========== RIGHT PANEL ========== */
.benefits-panel {
  width: 340px;
  min-width: 340px;
  max-height: 650px;
  border-radius: 16px;
  border: 1px solid var(--neutral-700);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;
}
.benefits-top {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.benefits-title {
  font-size: 18px;
  font-weight: 500;
}
.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.benefit-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.benefit-item span {
  font-size: 12px;
  line-height: 1.5;
}
.benefits-bottom {
  flex: 1;
  min-height: 450px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 90% 60% at 50% 30%, rgba(67, 35, 98, 0.7) 0%, rgba(31, 16, 45, 0.5) 40%, rgba(0, 0, 0, 0.8) 100%);
}
.benefits-bottom .girl-back {
  position: absolute;
  bottom: 0;
  left: -16px;
  width: 193px;
  height: 450px;
  object-fit: cover;
  z-index: 1;
}
.benefits-bottom .girl-front {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-30%);
  width: 275px;
  height: 450px;
  object-fit: cover;
  z-index: 2;
}
.benefits-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  width: 280px;
  height: 280px;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}
.benefits-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(101, 51, 149, 0.5) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .content-layout {
    flex-direction: column;
    overflow-y: auto;
  }
  .content-left {
    overflow: visible;
  }
  .benefits-panel {
    width: 100%;
    min-width: 100%;
  }
  .benefits-bottom {
    min-height: 350px;
  }
  .benefits-bottom .girl-back {
    width: 160px;
    height: 350px;
  }
  .benefits-bottom .girl-front {
    width: 230px;
    height: 350px;
  }
}

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    gap: 8px;
  }
  .packages-row {
    max-width: 420px;
  }
  .package-card {
    width: calc(50% - 4px);
    min-width: 0;
  }
  /* Stretch a lonely last card (odd count) to full width of the row. */
  .packages-row > .package-card:last-child:nth-child(odd) {
    width: 100%;
  }
  /* Flash-sale banner on tablet/mobile: stack the two halves vertically but
     keep each half as a compact horizontal row. Tighten paddings and type
     so the banner doesn't dominate the page. */
  .flash-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
  }
  .flash-left {
    flex: 0 0 auto;
    gap: 8px;
    flex-wrap: wrap;
  }
  .flash-label {
    font-size: 15px;
    line-height: 20px;
    letter-spacing: 1.2px;
  }
  .flash-sub {
    font-size: 12px;
    line-height: 16px;
  }
  .flash-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 4px 4px 14px;
    border-radius: 999px;
  }
  .flash-right-text {
    font-size: 12px;
    line-height: 16px;
  }
  .flash-timer {
    font-size: 14px;
    line-height: 20px;
    padding: 4px 14px;
  }
  .credits-section {
    padding: 32px 0;
  }
}

@media (max-width: 480px) {
  /* Keep 2 credit packages per row on small phones (previous 1-per-row
     layout made the page scroll forever). */
  .packages-row {
    max-width: 100%;
    gap: 8px;
  }
  .package-card {
    width: calc(50% - 4px);
    max-width: none;
    min-width: 0;
  }
  /* When a row has an odd number of cards, stretch the trailing one to
     full width so it doesn't look orphaned at 50% on its own line. */
  .packages-row > .package-card:last-child:nth-child(odd) {
    width: 100%;
  }
}
