/* Reset and Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background: #1a1a2e;
  color: white;
  padding: 15px 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #6c5ce7;
  text-decoration: none;
}

.nav-links a {
  color: #ccc;
  text-decoration: none;
  margin-left: 20px;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
}

.env-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.env-badge.test {
  background: #ffeaa7;
  color: #d35400;
}

.env-badge.live {
  background: #00b894;
  color: white;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-primary {
  background: #6c5ce7;
  color: white;
}

.btn-primary:hover {
  background: #5f4dd0;
}

.btn-secondary {
  background: #ddd;
  color: #333;
}

.btn-secondary:hover {
  background: #ccc;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
}

/* Cards */
.card {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card h2 {
  margin-bottom: 10px;
  color: #1a1a2e;
}

.card p {
  color: #666;
  margin-bottom: 15px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0;
}

.hero h1 {
  font-size: 2.5rem;
  color: #1a1a2e;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.2rem;
  color: #666;
}

/* Forms */
.form-container {
  max-width: 500px;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section {
  margin-bottom: 25px;
}

.form-section h3 {
  margin-bottom: 15px;
  color: #1a1a2e;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #6c5ce7;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Checkout */
.checkout-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
  margin: 30px 0;
}

.checkout-summary {
  background: white;
  padding: 25px;
  border-radius: 10px;
  height: fit-content;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.checkout-form {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.order-item,
.order-total {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
}

.order-total {
  font-size: 1.2rem;
}

/* Test Cards */
.test-cards {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.test-cards h3 {
  margin-bottom: 10px;
}

.test-card-row {
  cursor: pointer;
  transition: background 0.2s;
}

.test-card-row:hover {
  background: #f0f0f0;
}

.hint {
  font-size: 0.85rem;
  color: #666;
  margin-top: 10px;
}

/* Result pages */
.result-container {
  max-width: 500px;
  margin: 60px auto;
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 40px;
}

.success .result-icon {
  background: #d4edda;
  color: #28a745;
}

.failure .result-icon,
.error .result-icon {
  background: #f8d7da;
  color: #dc3545;
}

.payment-details {
  text-align: left;
  margin: 30px 0;
}

.payment-details table {
  width: 100%;
}

.payment-details td {
  padding: 8px 0;
}

.payment-details td:first-child {
  color: #666;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.status-badge.success {
  background: #d4edda;
  color: #28a745;
}

.status-badge.failure {
  background: #f8d7da;
  color: #dc3545;
}

/* Tables */
.data-table {
  width: 100%;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
}

.data-table th {
  background: #f5f5f5;
  font-weight: 600;
}

.data-table tr:not(:last-child) {
  border-bottom: 1px solid #eee;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px;
  background: white;
  border-radius: 10px;
  color: #666;
}

/* Detail card */
.detail-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.detail-card table {
  width: 100%;
}

.detail-card td {
  padding: 10px 0;
}

.detail-card pre {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
}

/* Event types */
.event-type {
  font-family: monospace;
  background: #e8e8e8;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Webhook info */
.webhook-info {
  margin-top: 40px;
  background: white;
  padding: 25px;
  border-radius: 10px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #6c5ce7;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
}

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.detail-item {
  padding: 10px 0;
}

.detail-label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 5px;
}

.detail-value {
  display: block;
  font-size: 1rem;
  color: #333;
  font-weight: 500;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.detail-section {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #eee;
}

.detail-section h3 {
  margin-bottom: 15px;
  color: #1a1a2e;
}

.detail-actions {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

/* Status Badges for different states */
.status-active, .status-succeeded {
  background: #d4edda;
  color: #28a745;
}

.status-trialing {
  background: #cce5ff;
  color: #004085;
}

.status-past_due, .status-failed {
  background: #f8d7da;
  color: #dc3545;
}

.status-canceled, .status-cancelled {
  background: #e2e3e5;
  color: #383d41;
}

.status-paused {
  background: #fff3cd;
  color: #856404;
}

.status-pending, .status-scheduled {
  background: #ffeaa7;
  color: #d35400;
}

.status-completed, .status-paid {
  background: #d4edda;
  color: #28a745;
}

.status-defaulted {
  background: #f8d7da;
  color: #dc3545;
}

/* Form Card */
.form-card {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-width: 600px;
}

.form-card h3 {
  margin-top: 25px;
  margin-bottom: 15px;
  color: #1a1a2e;
}

.form-card h3:first-child {
  margin-top: 0;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 0.85rem;
}

/* Alert */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.badge.recommended {
  background: #6c5ce7;
  color: white;
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 10px;
}

/* Large Button */
.btn-lg {
  padding: 15px 30px;
  font-size: 1.1rem;
}

/* Footer */
footer {
  margin-top: 60px;
  padding: 20px 0;
  text-align: center;
  color: #666;
}

/* Responsive */
@media (max-width: 768px) {
  .checkout-container {
    grid-template-columns: 1fr;
  }

  .navbar .container {
    flex-direction: column;
    gap: 10px;
  }
}
