:root {
  --bg-dark: #0a0e17;
  --card-bg: rgba(20, 27, 45, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.25);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Ambient Glows */
.background-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.35;
  pointer-events: none;
}
.glow-1 {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #2563eb, transparent 70%);
}
.glow-2 {
  top: 30%;
  right: -100px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
}

.header-container, .main-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.app-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 23, 0.88);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  font-size: 2.2rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.4rem 0.6rem;
  border-radius: 12px;
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand h1 span {
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* User Panel / Auth Header */
.user-panel {
  display: flex;
  align-items: center;
}

.auth-buttons {
  display: flex;
  gap: 0.6rem;
}

.user-info-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 24px;
}

.user-avatar {
  background: rgba(59, 130, 246, 0.2);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.95rem;
}

.user-info-badge strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.1;
}

.user-info-badge small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.btn-icon-only {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-icon-only:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Main Container & Cards */
.main-container {
  padding-top: 2rem;
  padding-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}
.badge.primary { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge.success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge.danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease-in-out;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-link:hover {
  text-decoration: underline;
}

/* Code Snippet Box */
.code-box-wrapper {
  background: #05080f;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-copy {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.btn-copy:hover {
  background: rgba(59, 130, 246, 0.3);
}

pre {
  padding: 1rem;
  overflow-x: auto;
}

pre code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #93c5fd;
  line-height: 1.4;
}

.sdk-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  border-top: 1px dashed var(--card-border);
  padding-top: 1.25rem;
}

.feature-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.feature-icon {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem;
  border-radius: 8px;
}

.feature-item strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.feature-item p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Simulation Grid */
.checkout-simulation-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  text-align: left;
}
.btn-outline strong { display: block; font-size: 0.95rem; }
.btn-outline small { display: block; font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
.btn-outline.success:hover { border-color: var(--success); background: var(--success-glow); }
.btn-outline.warning:hover { border-color: var(--warning); background: rgba(245, 158, 11, 0.15); }
.btn-outline.danger:hover { border-color: var(--danger); background: var(--danger-glow); }

/* Forms */
.form-group {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}

textarea, input {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus, input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Verdict Banner */
.verdict-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}
.verdict-banner.legit {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}
.verdict-banner.legit .verdict-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.verdict-banner.diverted {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fecaca;
}
.verdict-banner.diverted .verdict-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.verdict-icon {
  font-size: 2.2rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.verdict-banner h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Grid Details */
.grid-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.detail-block {
  background: rgba(10, 14, 23, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
}

.detail-block h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #93c5fd;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
}

.data-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.data-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

.data-table th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Footer */
.app-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
}
