/* ============================================================
   paywall.css — 占卜平台付費牆與廣告樣式
   ============================================================ */

/* ===== Paywall Overlay ===== */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 20, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.paywall-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ===== Paywall Modal ===== */
.paywall-modal {
  background: linear-gradient(170deg, rgba(16, 20, 56, 0.98), rgba(10, 12, 36, 0.98));
  border: 2px solid var(--gold, #c9a84c);
  border-radius: 18px;
  width: 94%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem 2rem;
  position: relative;
  box-shadow:
    0 0 60px rgba(201, 168, 76, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.6);
  animation: paywallSlideIn 0.45s cubic-bezier(.25, .8, .25, 1);
}

@keyframes paywallSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close button */
.paywall-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim, #8890b8);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}

.paywall-close:hover {
  border-color: var(--gold, #c9a84c);
  color: var(--gold-l, #e8d088);
  background: rgba(201, 168, 76, 0.1);
}

/* Header */
.paywall-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.paywall-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.4));
}

.paywall-title {
  font-size: 1.5rem;
  color: var(--gold-l, #e8d088);
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.paywall-subtitle {
  color: var(--text-dim, #8890b8);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Remaining uses badge */
.paywall-remaining {
  display: inline-block;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-size: 0.82rem;
  color: var(--gold-l, #e8d088);
  margin-bottom: 1rem;
}

/* ===== Pricing Cards ===== */
.paywall-pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
}

.pricing-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(120, 150, 255, 0.12);
  border-radius: 12px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
  position: relative;
}

.pricing-card:hover {
  border-color: var(--gold, #c9a84c);
  background: rgba(201, 168, 76, 0.04);
}

.pricing-card.popular {
  border-color: var(--gold, #c9a84c);
  background: rgba(201, 168, 76, 0.06);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.08);
}

.pricing-card.popular::before {
  content: "推薦";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold, #c9a84c), var(--gold-l, #e8d088));
  color: #1a1230;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.7rem;
  border-radius: 10px;
  letter-spacing: 0.05em;
}

.pricing-name {
  font-size: 0.85rem;
  color: var(--text-dim, #8890b8);
  margin-bottom: 0.5rem;
}

.pricing-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-l, #e8d088);
  margin-bottom: 0.2rem;
}

.pricing-price .currency {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim, #8890b8);
}

.pricing-period {
  font-size: 0.75rem;
  color: var(--text-dim, #8890b8);
}

/* ===== New Paywall Price Cards ===== */
.paywall-price-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}
.paywall-price-card {
  background: rgba(16,20,56,0.6);
  border: 1px solid rgba(100,140,255,0.15);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}
.paywall-price-card.active {
  border-color: rgba(201,168,76,0.4);
  background: rgba(201,168,76,0.05);
}
.paywall-price-card:hover {
  border-color: rgba(201,168,76,0.5);
  transform: translateY(-2px);
}
.price-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }
.price-label { color: #e0e8f8; font-weight: 700; font-size: 0.95rem; }
.price-amount { font-size: 1.8rem; color: #e8d088; font-weight: 700; margin: 0.3rem 0; }
.price-amount span { font-size: 0.8rem; color: #8890b8; }
.price-desc { font-size: 0.75rem; color: #8890b8; margin-bottom: 0.5rem; }
.price-badge {
  position: absolute; top: -8px; right: 8px;
  background: #c9a84c; color: #1a1230;
  padding: 0.15rem 0.5rem; border-radius: 8px;
  font-size: 0.65rem; font-weight: 700;
}
.price-buy-btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, #c9a84c, #e8d088);
  color: #1a1230;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.3s;
}
.price-buy-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(201,168,76,0.3);
}

@media (max-width: 520px) {
  .paywall-price-cards { grid-template-columns: 1fr; }
}

/* ===== Unlock Code Input ===== */
.paywall-unlock {
  margin-bottom: 1.5rem;
}

.unlock-label {
  display: block;
  color: var(--text-dim, #8890b8);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.unlock-input-row {
  display: flex;
  gap: 0.5rem;
}

.unlock-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(120, 150, 255, 0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text, #e0e8f8);
  font-size: 0.95rem;
  font-family: "Courier New", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.25s;
}

.unlock-input::placeholder {
  color: rgba(136, 144, 184, 0.4);
  text-transform: none;
  font-family: inherit;
  letter-spacing: normal;
}

.unlock-input:focus {
  outline: none;
  border-color: var(--purple-l, #7b68ee);
  box-shadow: 0 0 12px rgba(123, 104, 238, 0.15);
}

.unlock-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--purple, #4a35a0), var(--purple-l, #7b68ee));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.unlock-btn:hover {
  box-shadow: 0 4px 16px rgba(123, 104, 238, 0.4);
  transform: translateY(-1px);
}

.unlock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Unlock message */
.unlock-message {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 0.6rem;
  min-height: 1.2em;
  transition: all 0.3s;
}

.unlock-message.success {
  color: var(--success, #40c080);
}

.unlock-message.error {
  color: var(--danger, #e05070);
}

/* ===== Contact / Purchase Info ===== */
.paywall-contact {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(120, 150, 255, 0.08);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.paywall-contact h4 {
  color: var(--accent, #88aaff);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.paywall-contact p {
  color: var(--text-dim, #8890b8);
  font-size: 0.85rem;
  line-height: 1.7;
}

.paywall-contact .line-id {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 1.2rem;
  background: rgba(6, 199, 85, 0.12);
  border: 1px solid rgba(6, 199, 85, 0.3);
  border-radius: 20px;
  color: #40c080;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

/* ===== Action Buttons ===== */
.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.paywall-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.paywall-btn-primary {
  background: linear-gradient(135deg, var(--gold, #c9a84c), var(--gold-l, #e8d088));
  color: #1a1230;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
  letter-spacing: 0.05em;
}

.paywall-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(201, 168, 76, 0.45);
}

.paywall-btn-secondary {
  background: transparent;
  border: 1px solid rgba(120, 150, 255, 0.2);
  color: var(--text-dim, #8890b8);
}

.paywall-btn-secondary:hover {
  border-color: var(--purple-l, #7b68ee);
  color: var(--text, #e0e8f8);
  background: rgba(123, 104, 238, 0.06);
}

/* ===== Stats Bar ===== */
.paywall-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(120, 150, 255, 0.06);
  margin-top: 1rem;
}

.paywall-stat {
  text-align: center;
}

.paywall-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-l, #e8d088);
}

.paywall-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim, #8890b8);
  margin-top: 0.15rem;
}

/* ===== Premium Badge (shown on page when premium) ===== */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(201, 168, 76, 0.08));
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 20px;
  color: var(--gold-l, #e8d088);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.premium-badge::before {
  content: "\2B50";
  font-size: 0.85rem;
}

/* ===== Ad Slots ===== */
.ad-slot {
  width: 100%;
  min-height: 90px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px dashed rgba(120, 150, 255, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}

.ad-slot::after {
  content: "AD";
  font-size: 0.7rem;
  color: rgba(136, 144, 184, 0.2);
  letter-spacing: 0.3em;
  font-weight: 600;
}

.ad-slot.ad-before-results {
  min-height: 100px;
}

.ad-slot.ad-between-sections {
  min-height: 90px;
}

.ad-slot.ad-after-interpretation {
  min-height: 120px;
}

/* Hide ads for premium users */
body.is-premium .ad-slot {
  display: none !important;
}

/* ===== Free Uses Indicator ===== */
.free-uses-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(120, 150, 255, 0.1);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-dim, #8890b8);
}

.free-uses-indicator .uses-count {
  font-weight: 700;
  color: var(--gold-l, #e8d088);
}

.free-uses-indicator.exhausted {
  border-color: rgba(224, 80, 112, 0.3);
}

.free-uses-indicator.exhausted .uses-count {
  color: var(--danger, #e05070);
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .paywall-modal {
    padding: 2rem 1.2rem;
    margin: 0.5rem;
  }

  .paywall-title {
    font-size: 1.25rem;
  }

  .paywall-pricing {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .pricing-card {
    padding: 1rem 0.5rem;
  }

  .pricing-price {
    font-size: 1.2rem;
  }

  .unlock-input-row {
    flex-direction: column;
  }

  .unlock-btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .paywall-pricing {
    grid-template-columns: 1fr;
  }
}
