:root {
  --bg-dark: #07060a;
  --panel-bg: rgba(15, 12, 22, 0.65);
  --border-color: rgba(99, 102, 241, 0.2);
  --primary: #6366f1; /* Indigo */
  --secondary: #06b6d4; /* Cyan */
  --accent-glow: rgba(99, 102, 241, 0.12);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background Glow Effects */
.glow-orb {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  z-index: -1;
  filter: blur(90px);
  opacity: 0.3;
  pointer-events: none;
}
.orb-indigo {
  background: radial-gradient(circle, var(--primary) 0%, rgba(0,0,0,0) 70%);
  top: -100px;
  right: -100px;
}
.orb-cyan {
  background: radial-gradient(circle, var(--secondary) 0%, rgba(0,0,0,0) 70%);
  bottom: -150px;
  left: -150px;
}

/* Header */
.header {
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(7, 6, 10, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 6px;
  transform: rotate(45deg);
}

.title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}
.status-indicator.live {
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Layout */
.simulator-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  max-width: 1400px;
  width: 90%;
  margin: 2rem auto;
  flex: 1;
}

@media (max-width: 1024px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.checkout-panel {
  display: flex;
  flex-direction: column;
}

.billing-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
}

.badge-payment {
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.ledger-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.btn-decline {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.btn-decline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-decline:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.4;
}

.btn-reset {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-reset:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

/* Right Panel: Webhook Execution */
.terminal-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Pipeline Node Section */
.pipeline-section {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(16px);
}

.pipeline-section h4 {
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-secondary);
}

.nodes-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.3s;
  padding: 10px;
  border-radius: 8px;
}

.node-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.5s ease;
}

.node-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.node-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: all 0.3s;
}

/* Node Animations */
.node-wrapper.active .node-icon {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--secondary);
  box-shadow: 0 0 15px var(--secondary);
  transform: scale(1.1);
}

.node-wrapper.active .node-name {
  color: white;
}

.node-wrapper.done .node-icon {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
  box-shadow: 0 0 15px var(--success);
}

.node-arrow.active {
  color: var(--secondary);
  text-shadow: 0 0 8px var(--secondary);
  animation: arrow-glow 0.8s alternate infinite;
}

@keyframes arrow-glow {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Tabs */
.outputs-section {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.tab-headers {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 1rem 1.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: white;
  border-bottom-color: var(--secondary);
  background: rgba(6, 182, 212, 0.05);
}

.tab-contents {
  flex: 1;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.15);
  min-height: 380px;
}

.tab-content {
  display: none;
  height: 100%;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Terminal View Output */
.terminal-view {
  background: #040306;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Fira Code', monospace;
}

.terminal-header {
  background: #110f16;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.term-dot.red { background-color: var(--error); }
.term-dot.yellow { background-color: var(--warning); }
.term-dot.green { background-color: var(--success); }

.term-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.terminal-body {
  padding: 1rem;
  overflow-y: auto;
  font-size: 0.85rem;
  flex: 1;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line {
  color: #c7d2fe;
}
.log-line.system {
  color: #22d3ee;
}
.log-line.webhook {
  color: #a7f3d0;
}
.log-line.success {
  color: var(--success);
}
.log-line.error {
  color: var(--error);
}

/* Gmail View Tab */
.gmail-view {
  background: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.gmail-header-row {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.85rem;
  background-color: #f9fafb;
  display: flex;
  gap: 8px;
}

.gmail-label {
  font-weight: 600;
  color: #4b5563;
  min-width: 60px;
}

.gmail-val {
  color: #111827;
}

.gmail-body-container {
  padding: 2rem 1.5rem;
  background-color: #ffffff;
  min-height: 220px;
  overflow-y: auto;
}

.gmail-body-container a {
  display: inline-block;
  background-color: #4f46e5;
  color: white !important;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: 700;
  margin: 15px 0;
  font-size: 0.9rem;
}
.gmail-body-container a:hover {
  background-color: #4338ca;
}

.gmail-empty-state, .slack-empty-state {
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.08);
  background: transparent;
}

/* Slack Message UI */
.slack-msg-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-left: 4px solid var(--secondary);
  border-radius: 6px;
  animation: slide-in 0.4s ease-out;
}

.slack-msg-card.unqualified {
  border-left-color: var(--text-muted);
}

.slack-avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
}

.slack-msg-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  flex: 1;
}

.slack-user-name {
  font-weight: 700;
  color: white;
}

.slack-field {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-badge.qualified {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: #a7f3d0;
}

.status-badge.unqualified {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--error);
  color: #fca5a5;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
