/**
 * Wallet & Store Page Styles
 * RELLA Design System - Week 5
 *
 * Colors:
 * - Purple gradient: #c799f7 → #b574f3 (주요 버튼)
 * - Yellow gradient: #FFF8DC → #FFE88A (배경)
 * - Dark purple: #3b2141 (텍스트)
 */

/* ================================================
   STORE PAGE
   ================================================ */

.store-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 40px;
  min-height: calc(100vh - 200px);
}

/* Store Header */
.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 50px;
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid rgba(185, 126, 245, 0.2);
}

.store-title-section h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--dark-purple);
  margin-bottom: 12px;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.store-description {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
}

/* Balance Section */
.store-balance-section {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.balance-card {
  background: var(--button-gradient);
  padding: 20px 28px;
  border-radius: 16px;
  color: white;
  text-align: center;
  min-width: 140px;
  box-shadow: 0 4px 12px rgba(185, 126, 245, 0.3);
  transition: all 0.3s ease;
}

.balance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(185, 126, 245, 0.4);
}

.balance-label {
  display: block;
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.balance-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.btn-transactions {
  padding: 14px 24px;
  background: white;
  border: 2px solid var(--purple);
  color: var(--purple);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.btn-transactions:hover {
  background: var(--purple);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(185, 126, 245, 0.3);
}

/* ================================================
   CURRENCY TOGGLE (v3.3)
   ================================================ */

.currency-toggle-section {
  text-align: center;
  margin-bottom: 40px;
}

.currency-toggle {
  display: inline-flex;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.currency-btn {
  padding: 12px 24px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.currency-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
  color: #333;
}

.currency-btn.active {
  background: var(--button-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(185, 126, 245, 0.3);
}

.currency-notice {
  margin-top: 12px;
  font-size: 14px;
  color: #666;
}

/* PayPal badge in modal */
.payment-method-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 12px;
}

.payment-method-badge.paypal {
  background: #0070ba;
  color: white;
}

/* Packages Grid */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.package-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.package-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--purple-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.package-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(185, 126, 245, 0.25);
  border-color: var(--purple);
}

.package-card:hover::before {
  transform: scaleX(1);
}

.package-card.popular {
  border-color: var(--purple);
  box-shadow: 0 6px 20px rgba(185, 126, 245, 0.3);
}

.package-card.popular::before {
  transform: scaleX(1);
}

.package-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--button-gradient);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(185, 126, 245, 0.4);
}

.package-header {
  margin-bottom: 20px;
}

.package-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark-purple);
  margin-bottom: 8px;
}

.bonus-tag {
  display: inline-block;
  background: linear-gradient(135deg, #FFD87A 0%, #FFC44D 100%);
  color: var(--brown);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 200, 77, 0.3);
}

.package-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.package-points {
  text-align: center;
  padding: 16px 0;
  background: linear-gradient(135deg, #FFF8DC 0%, #FFED9F 100%);
  border-radius: 12px;
}

.base-points {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--purple-dark);
  letter-spacing: -1px;
}

.total-points {
  display: block;
  font-size: 14px;
  color: var(--brown);
  margin-top: 4px;
  font-weight: 600;
}

.package-price {
  text-align: center;
  padding: 12px 0;
}

.package-price .currency {
  font-size: 18px;
  color: #666;
  margin-right: 4px;
}

.package-price .amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark-purple);
  letter-spacing: -0.5px;
}

.btn-purchase {
  width: 100%;
  padding: 14px 20px;
  background: var(--button-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(185, 126, 245, 0.3);
}

.btn-purchase:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(185, 126, 245, 0.4);
}

.btn-purchase:active {
  transform: translateY(0);
}

.btn-purchase:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.package-features {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.package-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.package-features li {
  font-size: 13px;
  color: #666;
  padding: 4px 0;
  position: relative;
  padding-left: 20px;
}

.package-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--purple);
  font-weight: 700;
}

/* Terms Section */
.store-terms {
  background: white;
  padding: 24px 32px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--dark-purple);
  cursor: pointer;
}

.terms-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--purple);
}

.terms-checkbox a {
  color: var(--purple);
  text-decoration: underline;
  margin-left: 8px;
}

.terms-checkbox a:hover {
  color: var(--purple-dark);
}

/* Store Footer */
.store-footer {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #FFF8DC 0%, #FFED9F 50%, #FFE88A 100%);
  border-radius: 16px;
}

.payment-info {
  font-size: 14px;
  color: var(--brown);
  font-weight: 600;
}

/* Store Error State */
.store-error {
  text-align: center;
  padding: 60px 20px;
}

.store-error h2 {
  font-size: 24px;
  color: var(--dark-purple);
  margin-bottom: 16px;
}

.store-error p {
  font-size: 16px;
  color: #666;
  margin-bottom: 24px;
}

.btn-retry {
  padding: 12px 32px;
  background: var(--button-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(185, 126, 245, 0.3);
  transition: all 0.3s ease;
}

.btn-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(185, 126, 245, 0.4);
}

/* ================================================
   TOAST NOTIFICATION
   ================================================ */

.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  min-width: 300px;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  font-size: 15px;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left: 4px solid #10b981;
  color: #065f46;
}

.toast-error {
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.toast-info {
  border-left: 4px solid var(--purple);
  color: var(--dark-purple);
}

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
  .store-page {
    padding: 40px 20px;
  }

  .store-header {
    flex-direction: column;
    gap: 24px;
  }

  .store-title-section h1 {
    font-size: 28px;
  }

  .store-balance-section {
    width: 100%;
    justify-content: center;
  }

  .balance-card {
    flex: 1;
    min-width: 120px;
  }

  .btn-transactions {
    width: 100%;
  }

  /* Currency toggle mobile */
  .currency-toggle-section {
    margin-bottom: 30px;
  }

  .currency-toggle {
    width: 100%;
    max-width: 300px;
  }

  .currency-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
  }

  .packages-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .package-card {
    padding: 24px;
  }

  .base-points {
    font-size: 28px;
  }

  .package-price .amount {
    font-size: 24px;
  }

  .toast {
    right: 10px;
    left: 10px;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .store-title-section h1 {
    font-size: 24px;
  }

  .balance-card {
    padding: 16px 20px;
    min-width: 100px;
  }

  .balance-value {
    font-size: 24px;
  }

  .package-card {
    padding: 20px;
  }
}

/* ================================================
   PLACEHOLDERS (for unified card heights)
   ================================================ */

.package-badge-placeholder,
.bonus-placeholder,
.total-placeholder {
  display: block;
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
}

/* ================================================
   TERMS MODAL
   ================================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #333;
  transform: rotate(90deg);
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-purple);
  margin-bottom: 24px;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.terms-content {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  margin-bottom: 24px;
  max-height: 300px;
  overflow-y: auto;
}

.terms-content p {
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  white-space: pre-wrap;
  margin: 0;
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  cursor: pointer;
  user-select: none;
}

.terms-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.terms-checkbox span {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

.modal-content .btn-purchase {
  margin-top: 0;
}

@media (max-width: 768px) {
  .modal-content {
    padding: 30px 24px;
    max-height: 90vh;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .terms-content {
    padding: 16px;
    max-height: 200px;
  }
}

/* ================================================
   PAYMENT MODAL (Toss Widget)
   ================================================ */

.modal-payment {
  max-width: 600px;
  padding: 40px;
}

.package-info-section {
  background: linear-gradient(135deg, #f8f4ff 0%, #fff8f0 100%);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 2px solid rgba(185, 126, 245, 0.2);
}

.package-summary h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark-purple);
  margin-bottom: 12px;
}

.points-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.points-summary .base {
  font-size: 24px;
  font-weight: 700;
  color: #9b59c0;
}

.points-summary .bonus {
  font-size: 14px;
  font-weight: 600;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
}

.price-summary {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

/* Toss widget containers */
#toss-payment-method {
  min-height: 200px;
  margin-bottom: 20px;
}

#toss-agreement {
  min-height: 100px;
  margin-bottom: 20px;
}

#modal-payment-confirm {
  width: 100%;
  margin-top: 20px;
}


/* ================================================
   REFUND POLICY SECTION
   ================================================ */

.refund-policy-section {
  max-width: 1200px;
  margin: 60px auto 60px;
  padding: 0 40px;
}

.refund-divider {
  border: none;
  border-top: 1px solid rgba(185, 126, 245, 0.2);
  margin: 0 0 24px 0;
}

.refund-policy-heading {
  font-size: 20px;
  font-weight: 700;
  color: #2d2d2d;
  margin: 0 0 20px 0;
  display: block;
}

.refund-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 20px;
}

.refund-card {
  border-radius: 12px;
  padding: 28px;
  transition: all 0.3s ease;
}

.refund-card:hover {
  border-color: rgba(185, 126, 245, 0.3);
  box-shadow: 0 4px 12px rgba(185, 126, 245, 0.08);
  transform: translateY(-2px);
}

.refund-card h4 {
  font-size: 18px;
  font-weight: 700;
  color: #2d2d2d;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(185, 126, 245, 0.2);
}

.refund-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.refund-card li {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
  padding-left: 24px;
  position: relative;
}

.refund-card li::before {
  content: "•";
  position: absolute;
  left: 8px;
  color: #b574f3;
  font-weight: bold;
  font-size: 18px;
}

.refund-policy-simple {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.refund-policy-simple p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary, #6b7280);
  margin: 0;
}

.refund-policy-simple strong {
  color: var(--text-primary, #2d2d2d);
  font-weight: 600;
}

.email-link {
  color: #b574f3;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

.email-link:hover {
  border-bottom-color: #b574f3;
  color: #9f5fdb;
}

/* Responsive */
@media (max-width: 768px) {
  .refund-policy-section {
    padding: 0 20px;
    margin: 40px auto 40px;
  }

  .refund-divider {
    margin: 0 0 20px 0;
  }

  .refund-policy-heading {
    font-size: 20px;
    margin-bottom: 24px;
  }

  .refund-policy-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .refund-card {
    padding: 24px;
  }

  .refund-card h4 {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .refund-card li {
    font-size: 13px;
    padding-left: 20px;
  }

  .refund-policy-simple {
    gap: 14px;
  }

  .refund-policy-simple p {
    font-size: 13px;
    line-height: 1.7;
  }
}
