/* Banner Section */
.game-banner {
  position: relative;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--primary-red);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  color: white;
}

.game-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.game-description {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Form Section */
.topup-form {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
}

.form-title {
  color: var(--primary-red);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 15px;
  text-align: center;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  color: var(--dark-gray);
  font-weight: 500;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.form-input {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-red);
}

/* Package Section */
.packages-section {
  margin-bottom: 30px;
}

.section-title {
  color: var(--primary-red);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.package-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.package-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-red);
}

.package-card.selected {
  border-color: var(--primary-red);
  background: var(--light-red);
}

.package-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-red), var(--accent-gold));
}

.package-image {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  margin-bottom: 15px;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-red);
}
.package-image img.point-icon {
  width: 85%;
}

.package-image img.image-url-icon {
  width: 100%;
}

.package-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: 8px;
}

.package-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 10px;
}

.package-original-price {
  font-size: 0.9rem;
  color: #999;
  text-decoration: line-through;
  margin-right: 8px;
}

.package-description {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 15px;
}

/* Promotion Badge */
.promotion-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--accent-gold);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  transform: rotate(15deg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.promotion-badge.discount {
  background: var(--primary-red);
}

.promotion-badge.hot {
  background: var(--success-green);
}

/* Special Package */
.package-special {
  background: linear-gradient(135deg, var(--light-red), #fff);
  border: 2px solid var(--primary-red);
}

.package-special::before {
  background: var(--primary-red);
}

/* Discount Section */
.discount-section {
  background: var(--light-gray);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 2px dashed #ddd;
  transition: all 0.3s ease;
}

.discount-section.active {
  border-color: var(--success-green);
  background: #f0fff4;
}

.discount-input-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.discount-input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.discount-input:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(212, 0, 26, 0.1);
}

.apply-discount-btn {
  background: var(--primary-red);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 80px;
}

.apply-discount-btn:hover {
  background: var(--dark-red);
}

.apply-discount-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.discount-status {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}

.discount-status.success {
  color: var(--success-green);
}

.discount-status.error {
  color: var(--primary-red);
}

/* Selected Indicator */
.selected-indicator {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 25px;
  height: 25px;
  background: var(--success-green);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
}

.package-card.selected .selected-indicator {
  display: flex;
}

/* Submit Section */
.submit-section {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(212, 0, 26, 0.1);
}

.order-summary {
  background: var(--light-gray);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.summary-row.total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-red);
  border-top: 1px solid #ddd;
  padding-top: 10px;
  margin-top: 15px;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(212, 0, 26, 0.3);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 0, 26, 0.4);
}

.submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .game-banner {
    height: 200px;
  }

  .game-title {
    font-size: 1.8rem;
  }

  .topup-form,
  .submit-section {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  /* ปรับ packages-grid ให้แสดง 3 คอลัมน์ในมือถือ */
  .packages-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  /* ปรับขนาด package-card ให้เล็กลง */
  .package-card {
    padding: 12px;
    border-radius: 12px;
  }

  .package-card::before {
    height: 3px;
  }

  /* ปรับขนาดรูปภาพให้เล็กลง */
  .package-image {
    width: 20px;
    height: 20px;
    margin-bottom: 8px;
    font-size: 1.2rem;
  }
  .package-image img.point-icon {
    width: 100%;
  }

  /* ปรับขนาดตัวอักษรให้เล็กลง */
  .package-name {
    font-size: 0.85rem;
    margin-bottom: 4px;
    line-height: 1.2;
  }

  .package-price {
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .package-original-price {
    font-size: 0.75rem;
  }

  .package-description {
    font-size: 0.75rem;
    margin-bottom: 8px;
    line-height: 1.3;
  }

  /* ปรับ promotion badge ให้เล็กลง */
  .promotion-badge {
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 0.65rem;
    border-radius: 12px;
  }

  /* ปรับ selected indicator ให้เล็กลง */
  .selected-indicator {
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  /* ปรับขนาดตัวอักษรในส่วนอื่นๆ */
  .section-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
  }

  .form-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }
}

/* สำหรับมือถือขนาดเล็กมาก */
@media (max-width: 480px) {
  .packages-grid {
    gap: 6px;
  }

  .package-card {
    padding: 10px;
  }

  .package-image {
    width: 20px;
    height: 20px;
    font-size: 1rem;
  }
  .package-image img.point-icon {
    width: 100%;
  }

  .package-name {
    font-size: 0.8rem;
  }

  .package-price {
    font-size: 0.9rem;
  }

  .package-description {
    font-size: 0.7rem;
  }

  .promotion-badge {
    padding: 2px 6px;
    font-size: 0.6rem;
  }
}
