/* ═══════════════════════════════════════════════
   JWTLab — Style Sheet v3
   CTF-consistent dark theme with cyan JWT accent
   ═══════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0b0f14;
  --bg-surface: rgba(10, 14, 20, 0.85);
  --bg-code: #060a0f;
  --bg-card: rgba(13, 18, 26, 0.75);
  --bg-input: #0d1117;

  --text: #d7fbe8;
  --text-muted: rgba(214, 255, 233, 0.7);
  --text-dim: rgba(214, 255, 233, 0.5);

  --accent: #00d4ff;
  --accent-dim: #0099cc;
  --accent-glow: #00d4ff40;
  --accent-ctf: #7cf7c0;

  --border: rgba(0, 212, 255, 0.15);
  --border-hover: rgba(0, 212, 255, 0.4);

  --header-color: #ff6b6b;
  --header-bg: #ff6b6b12;
  --header-border: #ff6b6b30;

  --payload-color: #b266ff;
  --payload-bg: #b266ff12;
  --payload-border: #b266ff30;

  --sig-color: #00d4ff;
  --sig-bg: #00d4ff12;
  --sig-border: #00d4ff30;

  --critical: #ff4757;
  --critical-bg: #ff475718;
  --high: #ffa502;
  --high-bg: #ffa50218;
  --medium: #ffd43b;
  --medium-bg: #ffd43b18;
  --success: #2ed573;
  --danger: #ff4757;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, #0f1722, #0b0f14 45%, #06080b);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.4);
}

/* ═══════════════════════════════════════════════
   SITE NAV (CTF-consistent)
   ═══════════════════════════════════════════════ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem clamp(1.2rem, 3.5vw, 4.5rem);
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-ctf);
}

.nav-links {
  display: flex;
  gap: 0.3rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-ctf);
  background: rgba(124, 247, 192, 0.08);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(11, 15, 20, 0.98);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-hamburger {
    display: block;
  }
}

/* ═══════════════════════════════════════════════
   TERMINAL WINDOW (hero wrapper)
   ═══════════════════════════════════════════════ */
.terminal-window {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: rgba(13, 17, 23, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

.terminal-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 2.5rem 2rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.25;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-shadow:
    0 0 10px var(--accent),
    0 0 20px var(--accent),
    0 0 40px var(--accent-dim),
    0 0 80px var(--accent-dim),
    0 0 120px rgba(0, 212, 255, 0.15);
  position: relative;
  animation: glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  0% { text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent), 0 0 40px var(--accent-dim), 0 0 80px var(--accent-dim), 0 0 120px rgba(0,212,255,0.15); }
  100% { text-shadow: 0 0 15px var(--accent), 0 0 30px var(--accent), 0 0 60px var(--accent-dim), 0 0 100px var(--accent-dim), 0 0 160px rgba(0,212,255,0.25); }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   TABS (CTF nav-tab style)
   ═══════════════════════════════════════════════ */
.tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0 1.5rem;
  position: relative;
  max-width: 600px;
  margin: 0 auto 2rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  overflow: visible;
}

.tab {
  flex: 0 1 auto;
  padding: 0.85rem 1.4rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-badge {
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  line-height: 1.4;
}

.tab-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 33.333%;
  height: 2px;
  background: var(--accent);
  transition: transform var(--transition);
  box-shadow: 0 0 10px var(--accent-glow);
  display: none; /* hidden — using border-bottom on active tab instead */
}

/* ── Content ── */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  position: relative;
}

.tab-panel {
  display: none;
  animation: fadeSlideIn 0.4s ease;
}

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

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Decoder Input ── */
.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.jwt-input {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  word-break: break-all;
}

.jwt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(0, 212, 255, 0.1);
}

.jwt-input::placeholder {
  color: var(--text-dim);
}

.input-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── Buttons ── */
.btn {
  padding: 0.55rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #33ddff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:disabled {
  background: rgba(214, 255, 233, 0.15);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ── Decoded Sections ── */
.decoded-sections {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.decoded-sections.visible {
  opacity: 1;
}

.decoded-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.2rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.decoded-card:hover {
  transform: translateY(-2px);
}

/* Card split animation */
.decoded-card.animate-in {
  animation: splitIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.header-card.animate-in { animation-delay: 0ms; }
.payload-card.animate-in { animation-delay: 100ms; }
.signature-card.animate-in { animation-delay: 200ms; }

@keyframes splitIn {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header Card */
.header-card {
  border: 1px solid var(--header-border);
  background: var(--header-bg);
}

.header-card .card-label {
  color: var(--header-color);
}

/* Payload Card */
.payload-card {
  border: 1px solid var(--payload-border);
  background: var(--payload-bg);
}

.payload-card .card-label {
  color: var(--payload-color);
}

/* Signature Card */
.signature-card {
  border: 1px solid var(--sig-border);
  background: var(--sig-bg);
}

.signature-card .card-label {
  color: var(--sig-color);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.card-algo {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--header-color);
  background: rgba(255, 107, 107, 0.15);
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

/* ── JSON Display ── */
.json-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  max-height: 300px;
  overflow-y: auto;
}

.json-key {
  color: #ff6b6b;
}

.json-string {
  color: #98c379;
}

.json-number {
  color: #d19a66;
}

.json-boolean {
  color: #c678dd;
}

.json-null {
  color: #7c8495;
  font-style: italic;
}

/* ── Copy Button ── */
.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
  color: var(--text-muted);
}

.copy-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--text);
  border-color: var(--border-hover);
}

.copy-btn .check-icon {
  display: none;
  color: var(--success);
}

.copy-btn.copied .copy-icon {
  display: none;
}

.copy-btn.copied .check-icon {
  display: inline;
}

/* ── Claim Badges ── */
.claim-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.claim-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  background: var(--payload-bg);
  border: 1px solid var(--payload-border);
  color: var(--payload-color);
  cursor: default;
  white-space: nowrap;
}

.claim-badge.exp {
  background: rgba(255, 71, 87, 0.15);
  border-color: rgba(255, 71, 87, 0.3);
  color: #ff4757;
}

.claim-badge.iat,
.claim-badge.nbf {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.25);
  color: var(--accent);
}

/* ── Signature ── */
.signature-hex {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--sig-color);
  word-break: break-all;
  line-height: 1.6;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.verify-section {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.verify-input {
  flex: 1;
  padding: 0.45rem 0.7rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.verify-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.verify-result {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0;
  min-height: 1.6rem;
}

.verify-result.valid {
  color: var(--success);
}

.verify-result.invalid {
  color: var(--danger);
}

/* ── Security Analysis ── */
.analysis-section {
  margin-top: 2rem;
  opacity: 0;
  transition: opacity 0.5s ease 0.3s;
}

.analysis-section.visible {
  opacity: 1;
}

.analysis-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.findings-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.finding-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  animation: findingIn 0.4s ease forwards;
  opacity: 0;
}

.finding-item:nth-child(1) { animation-delay: 0ms; }
.finding-item:nth-child(2) { animation-delay: 60ms; }
.finding-item:nth-child(3) { animation-delay: 120ms; }
.finding-item:nth-child(4) { animation-delay: 180ms; }
.finding-item:nth-child(5) { animation-delay: 240ms; }
.finding-item:nth-child(6) { animation-delay: 300ms; }
.finding-item:nth-child(7) { animation-delay: 360ms; }
.finding-item:nth-child(8) { animation-delay: 420ms; }

@keyframes findingIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.finding-item.critical {
  background: var(--critical-bg);
  border-color: rgba(255, 71, 87, 0.25);
}

.finding-item.high {
  background: var(--high-bg);
  border-color: rgba(255, 165, 2, 0.25);
}

.finding-item.medium {
  background: var(--medium-bg);
  border-color: rgba(255, 212, 59, 0.25);
}

.finding-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.finding-content {
  flex: 1;
  min-width: 0;
}

.finding-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.finding-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.severity-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.severity-badge.critical {
  background: var(--critical);
  color: white;
}

.severity-badge.high {
  background: var(--high);
  color: var(--bg);
}

.severity-badge.medium {
  background: var(--medium);
  color: var(--bg);
}

.finding-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════
   ATTACKS TAB
   ═══════════════════════════════════════════════ */

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

.attacks-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.severity-filters {
  display: flex;
  gap: 0.35rem;
}

.filter-btn {
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  color: var(--text);
  border-color: var(--border-hover);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ── Attack Cards Grid ── */
.attacks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.attack-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.attack-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.attack-card.critical::before { background: var(--critical); }
.attack-card.high::before { background: var(--high); }
.attack-card.medium::before { background: var(--medium); }

.attack-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.attack-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.attack-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  margin-right: 0.5rem;
}

.attack-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.attack-card-footer {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Attack Detail View ── */
.attack-detail {
  display: none;
  margin-top: 1.5rem;
  animation: fadeSlideIn 0.4s ease;
}

.attack-detail.active {
  display: block;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 1.5rem;
  padding: 0.3rem 0;
  transition: color var(--transition);
}

.detail-back:hover {
  color: #33ddff;
}

.detail-header {
  margin-bottom: 2rem;
}

.detail-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.detail-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 800px;
}

/* Steps */
.steps-container {
  position: relative;
  padding-left: 2rem;
}

.steps-container::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.step-item {
  position: relative;
  margin-bottom: 2rem;
  padding: 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-number {
  position: absolute;
  left: -2rem;
  top: 1.2rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 1;
}

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

.step-explanation {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* JWT State Visualization */
.jwt-state {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.jwt-state-single {
  grid-template-columns: 1fr;
}

.state-box {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  word-break: break-all;
  white-space: pre-wrap;
}

.state-box.before {
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.2);
}

.state-box.after {
  background: rgba(46, 213, 115, 0.08);
  border: 1px solid rgba(46, 213, 115, 0.2);
}

.state-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  opacity: 0.7;
}

.state-box.before .state-label { color: var(--danger); }
.state-box.after .state-label { color: var(--success); }

/* Code blocks */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-muted);
  position: relative;
}

.code-block .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

/* Real World & Prevention */
.detail-section {
  margin-top: 2rem;
  padding: 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.detail-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-section p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.try-it-btn {
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.try-it-btn:hover {
  background: #33ddff;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Brute Force Simulator */
.brute-force-sim {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
}

.brute-force-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.brute-force-input {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.brute-force-input input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.brute-force-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.brute-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.brute-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s linear;
}

.brute-log {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.6;
}

.brute-log .found {
  color: var(--success);
  font-weight: 600;
}

.brute-log .trying {
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════
   BUILDER TAB
   ═══════════════════════════════════════════════ */

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

.builder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.builder-output-card {
  grid-column: 1 / -1;
}

.builder-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent);
}

.builder-field {
  margin-bottom: 1rem;
}

.builder-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.builder-select,
.builder-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.builder-select:focus,
.builder-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.builder-select option {
  background: var(--bg);
}

.builder-textarea {
  width: 100%;
  min-height: 160px;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.builder-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.builder-textarea.small {
  min-height: 60px;
}

.claim-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.claim-btn {
  padding: 0.25rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition);
}

.claim-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.builder-output {
  padding: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  word-break: break-all;
  min-height: 60px;
  color: var(--text);
}

.builder-output .placeholder-text {
  color: var(--text-dim);
  font-style: italic;
}

.builder-output .token-header { color: var(--header-color); }
.builder-output .token-payload { color: var(--payload-color); }
.builder-output .token-dot { color: var(--text-dim); }
.builder-output .token-signature { color: var(--sig-color); }

.builder-output-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════
   FOOTER (CTF-consistent)
   ═══════════════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer a {
  color: var(--accent-ctf);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer strong {
  color: var(--accent-ctf);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .hero {
    padding: 2rem 1.2rem;
  }

  .terminal-window {
    margin: 1rem 0.5rem !important;
  }

  .tabs {
    margin: 0 1rem 1.5rem;
  }

  .tab {
    font-size: 0.82rem;
    padding: 0.7rem 0.5rem;
  }

  .decoded-sections {
    grid-template-columns: 1fr;
  }

  .builder-grid {
    grid-template-columns: 1fr;
  }

  .attacks-grid {
    grid-template-columns: 1fr;
  }

  .attacks-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .severity-filters {
    flex-wrap: wrap;
  }

  .jwt-state {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 0 1rem 2rem;
  }

  .detail-title {
    font-size: 1.2rem;
  }

  .verify-section {
    flex-direction: column;
  }

  .brute-force-input {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
  }

  .tab-badge {
    display: none;
  }
}
