/* ============================================
   BUY CREDITS MODAL STYLES
   ============================================ */

.aig-buy-credits-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.aig-buy-credits-modal.open {
  display: flex;
  opacity: 1;
}

.aig-buy-credits-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.aig-buy-credits-container {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 1.5rem;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.aig-buy-credits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.aig-buy-credits-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

.aig-buy-credits-title svg {
  color: #fbbf24;
}

.aig-buy-credits-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aig-buy-credits-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.aig-current-balance {
  margin: 1.5rem 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.aig-balance-icon {
  font-size: 2rem;
}

.aig-balance-info {
  flex: 1;
}

.aig-balance-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.25rem;
}

.aig-balance-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fbbf24;
}

.aig-buy-tabs {
  display: flex;
  gap: 1rem;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.aig-buy-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aig-buy-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.aig-buy-tab.active {
  color: #fff;
  border-bottom-color: #6366f1;
}

.aig-buy-content {
  padding: 2rem;
  min-height: 400px;
}

.aig-buy-tab-content {
  display: none;
}

.aig-buy-tab-content.active {
  display: block;
}

/* Custom Quantity Selector */
.aig-custom-selector {
  max-width: 500px;
  margin: 0 auto;
}

.aig-quantity-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.aig-qty-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aig-qty-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.aig-qty-btn:active {
  transform: scale(0.95);
}

.aig-qty-display {
  text-align: center;
}

.aig-qty-display input {
  width: 120px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s ease;
}

.aig-qty-display input:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.15);
}

.aig-qty-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.aig-incentive-message {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 1rem;
  margin-bottom: 2rem;
}

.aig-incentive-icon {
  font-size: 2rem;
}

.aig-incentive-text {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
}

.aig-price-display {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 1.5rem;
}

.aig-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.aig-price-row.aig-price-total {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0.5rem;
  padding-top: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.aig-price-value {
  font-weight: 600;
  color: #10b981;
}

/* Packs Grid */
.aig-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.aig-pack-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.aig-pack-card:hover {
  transform: translateY(-5px);
  border-color: #6366f1;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.aig-pack-card.featured {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
}

.aig-pack-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.aig-pack-discount {
  position: absolute;
  top: -10px;
  left: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.aig-pack-icon {
  margin-bottom: 1rem;
  color: #fbbf24;
}

.aig-pack-tokens {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.aig-pack-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
}

.aig-pack-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 0.5rem;
}

.aig-pack-per-credit {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
}

.aig-pack-description {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
  min-height: 40px;
}

.aig-pack-buy-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 0.75rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.aig-pack-buy-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Buy Footer */
.aig-buy-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.aig-buy-now-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 1rem;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.aig-buy-now-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.aig-buy-now-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading Overlay */
.aig-buy-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: 1.5rem;
  z-index: 10;
}

.aig-buy-loading p {
  color: #fff;
  font-size: 1.125rem;
  font-weight: 600;
}

/* Packs Loading State */
.aig-packs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.aig-packs-loading p {
  color: rgba(255, 255, 255, 0.7);
}

.aig-no-packs {
  text-align: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
  .aig-buy-credits-container {
    width: 95%;
    max-height: 95vh;
  }

  .aig-buy-credits-header {
    padding: 1.5rem;
  }

  .aig-buy-credits-title {
    font-size: 1.5rem;
  }

  .aig-current-balance {
    margin: 1rem 1.5rem;
    padding: 1rem;
  }

  .aig-buy-tabs {
    padding: 0 1.5rem;
  }

  .aig-buy-content {
    padding: 1.5rem;
  }

  .aig-packs-grid {
    grid-template-columns: 1fr;
  }

  .aig-quantity-control {
    gap: 1rem;
  }

  .aig-qty-btn {
    width: 50px;
    height: 50px;
  }

  .aig-qty-display input {
    width: 100px;
    font-size: 1.75rem;
  }
}
