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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  background-color: #f8f9fa;
  color: #212529;
  font-size: 16px;
}

.main-header {
  background-color: #f6f8fa;
  border-bottom: 1px solid #d0d7de;
  padding: 16px 0;
}

.header-content {
  max-width: 1200px;
  padding: 0 20px;
}

.header-text {
  font-size: 14px;
  font-weight: 600;
  color: #24292f;
  display: flex;
  align-items: center;
}

.header-icon {
  font-family: monospace;
  font-size: 18px;
  font-weight: bold;
  color: #6772e5;
  margin-right: 2px;
}

main {
  padding-top: 20px;
}

.container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  gap: 16px;
  padding: 16px;
}

/* Main content area */
.main-content {
  flex: 1;
  min-width: 0;
}

.section {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}

.section h2 {
  background: #f8f9fa;
  padding: 16px 24px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
}

/* Step styling */
.step {
  border-bottom: 1px solid #dee2e6;
}

.step:last-child {
  border-bottom: none;
}

.step-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  cursor: pointer;
  background: white;
  transition: background-color 0.2s;
}

.step-header:hover {
  background-color: #f8f9fa;
}

.step-header i {
  margin-right: 8px;
  color: #6c757d;
  transition: transform 0.2s;
  width: 12px;
}

.step-number {
  font-weight: 600;
  margin-right: 8px;
}

.step-title {
  flex: 1;
  font-weight: 500;
}

.amount-display {
  color: #6c757d;
  margin-left: auto;
  margin-right: 16px;
}

.float-right {
  margin-left: auto;
}

.step-content {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.step-input {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.step-content.expanded {
  max-height: 500px;
  padding: 16px 24px 24px;
}

.step-input {
  max-height: 500px;
  padding: 16px 24px 24px;
}

.step-content p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.step-input p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.subtitle {
  color: #6c757d;
  font-size: 15px;
  margin-bottom: 16px !important;
}

/* Form elements */
.input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.input-group .btn {
  flex-shrink: 0;
  min-width: fit-content;
  white-space: nowrap;
}

.form-control {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#amount-input {
  width: 100px;
}

#card-number-input {
  width: 100%;
  margin-bottom: 16px;
}

/* Button styling */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.05);
  padding: 6px 16px;
}

.btn-light {
  color: #24292f;
  background-color: #f6f8fa;
  border-color: #d0d7de;
}

.btn-light:hover {
  background-color: #f3f4f6;
  border-color: #bfc4ca;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top: 2px solid #212529;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Test cards section */
.card-input-section {
  margin-bottom: 24px;
}

.card-input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.test-cards h4 {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.test-card-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.test-card-row:last-child {
  border-bottom: none;
}

.test-card-label {
  flex: 1;
  font-size: 15px;
  color: #495057;
}

.test-card-number {
  font-family: Monaco, Menlo, "Ubuntu Mono", monospace;
  font-size: 15px;
  color: #007bff;
  margin-right: 8px;
}

/* Logs section */
.logs-section {
  flex: 1;
  min-width: 350px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  height: fit-content;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.logs-section h3 {
  padding: 16px 24px;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
}

.logs-header {
  padding: 12px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 500;
  font-size: 15px;
  color: #495057;
}

.logs-container {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* API Call Styling */
.api-call {
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 16px;
}

.api-call:last-child {
  border-bottom: none;
}

.api-title {
  padding: 12px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  font-family: Monaco, Menlo, "Ubuntu Mono", monospace;
  font-size: 15px;
}

.api-method {
  color: #0969da;
  font-weight: bold;
  margin-right: 8px;
}

.api-url {
  color: #24292f;
  flex: 1;
}

.api-status {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.status-200 {
  background-color: #1f883d;
  color: white;
}

.api-section {
  border-bottom: 1px solid #f0f0f0;
}

.api-section:last-child {
  border-bottom: none;
}

.section-title {
  padding: 12px 24px;
  background: #f6f8fa;
  color: #656d76;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid #d0d7de;
}

.section-content {
  background: white;
}

.section-content pre {
  margin: 0;
  padding: 16px 24px;
  background: #f6f8fa;
  font-family: Monaco, Menlo, "Ubuntu Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #24292f;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
}

.section-content code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Responsive design */
@media (max-width: 1200px) {
  .container {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .logs-section {
    min-width: unset;
    max-height: 400px;
  }

  .main-content {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 8px;
  }

  .step-header {
    padding: 12px 16px;
  }

  .step-content.expanded {
    padding: 12px 16px 16px;
  }

  .step-input {
    padding: 12px 16px 16px;
  }

  .section h2 {
    padding: 12px 16px;
  }

  .logs-section h3 {
    padding: 12px 16px;
  }

  .logs-header {
    padding: 8px 16px;
  }

  .log-title {
    padding: 6px 16px;
  }

  .log pre {
    padding: 12px 16px;
  }
}

/* Additional status indicators */
.status-success {
  color: #28a745;
}

.status-warning {
  color: #ffc107;
}

.status-error {
  color: #dc3545;
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.step-header:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.step-header:focus {
  outline-offset: -2px;
}