:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #121829;
  --bg-card: rgba(18, 24, 41, 0.85);
  --bg-card-hover: rgba(28, 37, 65, 0.95);
  --border-color: rgba(66, 153, 225, 0.2);
  --border-hover: rgba(66, 153, 225, 0.5);
  --text-primary: #f7fafc;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #7f53ac;
  --status-success: #10b981;
  --status-blocked: #ef4444;
  --status-warn: #f59e0b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 15% 50%, rgba(79, 172, 254, 0.08) 0%, transparent 40%),
                    radial-gradient(circle at 85% 30%, rgba(127, 83, 172, 0.08) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(127, 83, 172, 0.2));
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(79, 172, 254, 0.3);
}

.logo-brand {
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

.logo-product {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.env-tag {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.live {
  background: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
}

.dot.pulse {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-anim 1.5s infinite;
}

@keyframes pulse-anim {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Container */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
  width: 100%;
}

/* Hero */
.hero-card {
  background: linear-gradient(135deg, rgba(18, 24, 41, 0.9), rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-content h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.headers-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-pill {
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.header-pill .label {
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.header-pill .value {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Tabs */
.demo-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: var(--accent-cyan);
  background: rgba(79, 172, 254, 0.12);
  border-bottom: 2px solid var(--accent-cyan);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.attack-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(8px);
}

.attack-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.owasp-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.owasp-badge.api {
  background: rgba(147, 51, 234, 0.15);
  color: #c084fc;
  border-color: rgba(147, 51, 234, 0.3);
}

.attack-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.input-payload {
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--accent-cyan);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 100%;
}

.input-payload:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(79, 172, 254, 0.3);
}

.input-payload.textarea {
  min-height: 60px;
  resize: vertical;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  flex: 1;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
}

.btn-outline:hover {
  background: rgba(0, 242, 254, 0.1);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.defense-info {
  background: rgba(10, 14, 26, 0.5);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.6rem 0.8rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: auto;
}

.defense-info strong {
  color: var(--accent-cyan);
}

/* Inspector / Tables */
.inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.table-wrapper {
  overflow-x: auto;
}

.headers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.headers-table th, .headers-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.headers-table th {
  background: rgba(10, 14, 26, 0.7);
  color: var(--text-secondary);
  font-weight: 600;
}

.code-cell {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 600;
}

.code-val-cell {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  word-break: break-all;
}

.tag-imperva {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-cf {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.tag-std {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* cURL Box */
.curl-box {
  background: rgba(10, 14, 26, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.curl-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.curl-box pre {
  background: #000;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  margin-bottom: 0.6rem;
}

/* Architecture Flow */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.flow-step {
  background: rgba(10, 14, 26, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.2rem;
  flex: 1;
  min-width: 180px;
  text-align: center;
  position: relative;
}

.flow-step.highlight {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.15);
}

.step-num {
  width: 24px;
  height: 24px;
  background: var(--accent-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  margin: 0 auto 0.6rem auto;
}

.flow-step h4 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.flow-step p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* Response Console */
.response-console {
  background: #070a13;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 2rem;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.2rem;
  background: rgba(18, 24, 41, 0.95);
  border-bottom: 1px solid var(--border-color);
}

.console-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.console-meta {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.console-body {
  padding: 1.2rem;
}

.console-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .console-split {
    grid-template-columns: 1fr;
  }
}

.console-req h4, .console-res h4 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.console-req pre, .console-res pre {
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.console-res.status-blocked pre {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.console-res.status-passed pre {
  border-color: rgba(16, 185, 129, 0.5);
  color: #86efac;
}

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