/* Credits Page Styles */

.credits-plans {
  margin-top: 2rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.plan-card {
  background: rgb(var(--content1));
  border: 1px solid rgb(var(--default-200));
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  transition: all 0.3s ease;
}

.plan-card:hover {
  border-color: rgb(var(--primary));
  box-shadow: var(--shadow-large);
  transform: translateY(-2px);
}

.plan-featured {
  border-color: rgb(var(--primary));
  box-shadow: var(--shadow-large);
  position: relative;
}

.plan-featured::before {
  content: attr(data-popular-text);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgb(var(--primary));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-header {
  text-align: center;
  margin-bottom: 2rem;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgb(var(--foreground));
  margin: 0 0 0.5rem 0;
}

.plan-price {
  font-size: 3rem;
  font-weight: 700;
  color: rgb(var(--primary));
  margin: 0 0 1rem 0;
  line-height: 1;
}

.plan-description {
  color: rgb(var(--default-500));
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

.plan-features {
  margin-bottom: 2rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: rgb(var(--foreground));
}

.feature-item:last-child {
  margin-bottom: 0;
}

.feature-icon {
  flex-shrink: 0;
}

.plan-button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: rgb(var(--content1));
  border: 2px solid rgb(var(--default-300));
  border-radius: 8px;
  color: rgb(var(--foreground));
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-button:hover {
  background: rgb(var(--default-100));
  border-color: rgb(var(--primary));
}

.plan-button-featured {
  background: rgb(var(--primary));
  border-color: rgb(var(--primary));
  color: white;
}

.plan-button-featured:hover {
  background: rgb(var(--primary-600));
  border-color: rgb(var(--primary-600));
}

.custom-credits {
  text-align: center;
  padding: 2rem;
  background: rgb(var(--content1));
  border: 1px solid rgb(var(--default-200));
  border-radius: 12px;
  margin-top: 2rem;
}

.custom-credits p {
  margin: 0;
  color: rgb(var(--default-500));
  font-size: 0.875rem;
}

.custom-link {
  color: rgb(var(--primary));
  text-decoration: none;
  font-weight: 500;
}

.custom-link:hover {
  text-decoration: underline;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .plan-card {
  background: rgb(var(--content2));
  border-color: rgb(var(--default-300));
}

[data-theme="dark"] .plan-card:hover {
  border-color: rgb(var(--primary));
}

[data-theme="dark"] .plan-featured {
  border-color: rgb(var(--primary));
}

[data-theme="dark"] .plan-button {
  background: rgb(var(--content2));
  border-color: rgb(var(--default-400));
}

[data-theme="dark"] .plan-button:hover {
  background: rgb(var(--default-200));
}

[data-theme="dark"] .custom-credits {
  background: rgb(var(--content2));
  border-color: rgb(var(--default-300));
}

/* Custom Credits Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: rgb(var(--content1));
  border-radius: 16px;
  box-shadow: var(--shadow-large);
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgb(var(--default-200));
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: rgb(var(--foreground));
}

.modal-close {
  background: none;
  border: none;
  color: rgb(var(--default-500));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgb(var(--default-100));
  color: rgb(var(--foreground));
}

.modal-body {
  padding: 1.5rem;
}

.modal-description {
  margin: 0 0 2rem 0;
  color: rgb(var(--default-500));
  font-size: 0.875rem;
  text-align: center;
}

.credit-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.credit-btn {
  width: 48px;
  height: 48px;
  border: 2px solid rgb(var(--default-300));
  background: rgb(var(--content1));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgb(var(--foreground));
}

.credit-btn:hover {
  border-color: rgb(var(--primary));
  background: rgb(var(--default-100));
}

.credit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.credit-btn:disabled:hover {
  border-color: rgb(var(--default-300));
  background: rgb(var(--content1));
}

.credit-amount-display {
  min-width: 80px;
  text-align: center;
}

.credit-number {
  font-size: 2rem;
  font-weight: 700;
  color: rgb(var(--foreground));
}

.modal-buy-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: rgb(var(--primary));
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-buy-btn:hover {
  background: rgb(var(--primary-600));
}

/* Dark Theme Modal Adjustments */
[data-theme="dark"] .modal-content {
  background: rgb(var(--content2));
}

[data-theme="dark"] .modal-header {
  border-bottom-color: rgb(var(--default-300));
}

[data-theme="dark"] .modal-close:hover {
  background: rgb(var(--default-200));
}

[data-theme="dark"] .credit-btn {
  background: rgb(var(--content2));
  border-color: rgb(var(--default-400));
}

[data-theme="dark"] .credit-btn:hover {
  background: rgb(var(--default-200));
}

[data-theme="dark"] .credit-btn:disabled:hover {
  background: rgb(var(--content2));
  border-color: rgb(var(--default-400));
}

/* Responsive Design */
@media (max-width: 768px) {
  .plans-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .plan-card {
    padding: 1.5rem;
  }

  .plan-price {
    font-size: 2.5rem;
  }

  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
  }
}

@media (max-width: 480px) {
  .plan-card {
    padding: 1rem;
  }

  .plan-price {
    font-size: 2rem;
  }

  .custom-credits {
    padding: 1.5rem;
  }

  .modal-header,
  .modal-body {
    padding: 1rem;
  }

  .credit-input-container {
    gap: 0.75rem;
  }

  .credit-btn {
    width: 40px;
    height: 40px;
  }

  .credit-number {
    font-size: 1.75rem;
  }
}
