/**
 * Payment component styles
 * Includes checkout buttons, billing portal, and subscription status
 */

/* Payment Messages */
.payment-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-width: 400px;
  display: none;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

.payment-message.error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.payment-message.success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Subscription Status */
.subscription-status {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.subscription-active {
  text-align: center;
}

.subscription-active h3 {
  color: #166534;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.subscription-active p {
  color: #6b7280;
  margin-bottom: 8px;
}

.subscription-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.subscription-upgrade {
  text-align: center;
}

.subscription-upgrade h3 {
  color: #1f2937;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.subscription-upgrade p {
  color: #6b7280;
  margin-bottom: 24px;
}

/* Payment Buttons */
.payment-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.payment-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.payment-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.payment-btn.loading {
  color: transparent;
}

.payment-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Billing Portal Button */
.billing-portal-btn {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.billing-portal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Cancel Button */
.cancel-btn {
  background: #f87171;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

.cancel-btn:hover {
  background: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3);
}

/* Upgrade Button */
.upgrade-btn {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  text-decoration: none;
  display: inline-block;
}

.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Pricing Card Payment Buttons */
.pricing-card .payment-btn {
  width: 100%;
  margin-top: 16px;
}

.pricing-card .payment-btn.monthly {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pricing-card .payment-btn.yearly {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  margin-top: 8px;
}

.pricing-card .payment-btn.yearly::before {
  content: '💰 Save 17%';
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}

/* Plan Toggle */
.plan-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
}

.plan-toggle label {
  font-weight: 600;
  color: #374151;
}

.plan-toggle input[type="checkbox"] {
  width: 48px;
  height: 24px;
  appearance: none;
  background: #d1d5db;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-toggle input[type="checkbox"]:checked {
  background: #16a34a;
}

.plan-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.plan-toggle input[type="checkbox"]:checked::after {
  left: 26px;
}

.plan-toggle .savings {
  background: #dcfce7;
  color: #166534;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .payment-message {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .subscription-actions {
    flex-direction: column;
    align-items: center;
  }

  .subscription-actions button {
    width: 100%;
    max-width: 300px;
  }

  .plan-toggle {
    flex-direction: column;
    gap: 12px;
  }

  .pricing-card .payment-btn {
    font-size: 14px;
    padding: 10px 20px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .subscription-status {
    background: #1f2937;
    color: white;
  }

  .subscription-active h3 {
    color: #10b981;
  }

  .subscription-active p {
    color: #d1d5db;
  }

  .subscription-upgrade h3 {
    color: white;
  }

  .subscription-upgrade p {
    color: #d1d5db;
  }

  .plan-toggle {
    background: #374151;
  }

  .plan-toggle label {
    color: #f3f4f6;
  }
} 