/* ─── ZTW26 × Critical Thinking Brand Fusion ──────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1f3a;
  --bg-card: #132240;
  --bg-input: #0b1a30;
  --bg-hover: #1a2d52;

  --critical-red: #ea1c24;
  --binary-blue: #6fcbf3;
  --ztw-blue: #0098d6;
  --cipher-gray: #cacaca;
  --stealth-gray: #808080;
  --bug-green: #69bb53;

  --text-primary: #ffffff;
  --text-secondary: #cacaca;

  --font-primary: 'Fira Code', monospace;
  --font-secondary: 'Space Mono', monospace;

  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--binary-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--binary-blue);
}

/* ─── Top Nav ─────────────────────────────────────────────────────────── */

.top-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 32px;
  background: rgba(10, 22, 40, 0.95);
  border-bottom: 1px solid rgba(111, 203, 243, 0.15);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.nav-brand:hover { text-decoration: none; }

.ztw-logo { font-family: var(--font-secondary); font-weight: 700; color: var(--ztw-blue); letter-spacing: 2px; }
.ztw-26 { color: var(--binary-blue); }
.cross { color: var(--stealth-gray); font-size: 0.85em; }
.ct-logo { font-family: var(--font-primary); color: var(--text-primary); font-weight: 400; }
.ct-gray { color: var(--stealth-gray); }
.ct-red { color: var(--critical-red); font-weight: 700; }
.ct-white { color: var(--text-primary); }
.ct-blue { color: var(--binary-blue); }

.nav-links { display: flex; gap: 20px; justify-content: center; }
.nav-links a { color: var(--cipher-gray); font-size: 0.85rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--binary-blue); text-decoration: none; }

/* ─── Pages ───────────────────────────────────────────────────────────── */

.page { display: none; padding: 80px 32px 48px; max-width: 1100px; margin: 0 auto; }
.page.active { display: block; }

/* ─── Hero ────────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-family: var(--font-secondary);
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--binary-blue), var(--ztw-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--cipher-gray);
  font-size: 1rem;
  margin-bottom: 20px;
}

.hero-badges { display: flex; gap: 12px; justify-content: center; }

/* ─── Badges ──────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-server { background: rgba(0, 152, 214, 0.15); color: var(--ztw-blue); border: 1px solid rgba(0, 152, 214, 0.3); }
.badge-client { background: rgba(234, 28, 36, 0.12); color: var(--critical-red); border: 1px solid rgba(234, 28, 36, 0.3); }
.badge-success { background: rgba(105, 187, 83, 0.15); color: var(--bug-green); border: 1px solid rgba(105, 187, 83, 0.3); }
.badge-warning { background: rgba(234, 28, 36, 0.15); color: var(--critical-red); border: 1px solid rgba(234, 28, 36, 0.3); }
.badge-role { background: rgba(128, 128, 128, 0.2); color: var(--cipher-gray); border: 1px solid rgba(128, 128, 128, 0.3); font-size: 0.75rem; }

/* ─── Lab Cards Grid ──────────────────────────────────────────────────── */

.labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.lab-card {
  background: var(--bg-card);
  border: 1px solid rgba(111, 203, 243, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.25s;
}

.lab-card:hover {
  border-color: rgba(111, 203, 243, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(111, 203, 243, 0.08);
}

.lab-card h2 {
  font-family: var(--font-secondary);
  font-size: 1.3rem;
  margin: 14px 0 4px;
}

.lab-full-name {
  color: var(--stealth-gray);
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.lab-desc {
  color: var(--cipher-gray);
  font-size: 0.85rem;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ─── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-primary);
  font-size: 0.82rem;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: var(--ztw-blue);
  color: #fff;
}
.btn-primary:hover { background: #00adef; }

.btn-secondary {
  background: rgba(111, 203, 243, 0.1);
  color: var(--binary-blue);
  border: 1px solid rgba(111, 203, 243, 0.25);
}
.btn-secondary:hover { background: rgba(111, 203, 243, 0.2); }

.btn-danger {
  background: rgba(234, 28, 36, 0.15);
  color: var(--critical-red);
  border: 1px solid rgba(234, 28, 36, 0.3);
}
.btn-danger:hover { background: rgba(234, 28, 36, 0.3); }

.btn-success {
  background: rgba(105, 187, 83, 0.15);
  color: var(--bug-green);
  border: 1px solid rgba(105, 187, 83, 0.3);
}
.btn-success:hover { background: rgba(105, 187, 83, 0.3); }

.btn-sm { padding: 6px 14px; font-size: 0.75rem; }

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

/* ─── Lab Header & Tabs ───────────────────────────────────────────────── */

.lab-header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.lab-header-bar h1 {
  font-family: var(--font-secondary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-link, .back-btn {
  color: var(--stealth-gray);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.back-link:hover, .back-btn:hover { color: var(--binary-blue); text-decoration: none; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(111, 203, 243, 0.12);
  margin-bottom: 24px;
}

.tab {
  font-family: var(--font-primary);
  background: none;
  border: none;
  color: var(--stealth-gray);
  padding: 10px 18px;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab:hover { color: var(--cipher-gray); }
.tab.active { color: var(--binary-blue); border-bottom-color: var(--binary-blue); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.25s ease; }

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

/* ─── Cards & Info Boxes ──────────────────────────────────────────────── */

.card, .info-card, .report-card {
  background: var(--bg-card);
  border: 1px solid rgba(111, 203, 243, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.info-card h2, .report-card h2 { font-family: var(--font-secondary); font-size: 1.2rem; margin-bottom: 14px; }
.info-card h3 { color: var(--binary-blue); font-size: 0.95rem; margin: 20px 0 10px; }
.info-card p { color: var(--cipher-gray); font-size: 0.88rem; }
.info-card ol, .info-card ul { color: var(--cipher-gray); font-size: 0.88rem; margin-left: 20px; }
.info-card li { margin-bottom: 6px; }

.example-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--ztw-blue);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0;
}

.example-box h3 { margin-top: 0; }

.code-block {
  background: #080e1a;
  border: 1px solid rgba(111, 203, 243, 0.1);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 14px 0;
  overflow-x: auto;
}

.code-block code {
  background: none;
  padding: 0;
  color: var(--cipher-gray);
  font-size: 0.82rem;
  white-space: pre;
  display: block;
  line-height: 1.7;
}

.highlight-red { color: var(--critical-red); }
.highlight-green { color: var(--bug-green); }
.highlight-blue { color: var(--binary-blue); }

/* ─── Launch Card (Lab tab — links to standalone lab app) ─────────────── */

.launch-card {
  background: var(--bg-card);
  border: 1px solid rgba(111, 203, 243, 0.1);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
}

.launch-card .launch-icon {
  font-size: 2.8rem;
  margin-bottom: 16px;
}

.launch-card h2 {
  font-family: var(--font-secondary);
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.launch-card p {
  color: var(--cipher-gray);
  font-size: 0.88rem;
  max-width: 480px;
  margin: 0 auto 22px;
  line-height: 1.6;
}

.launch-card .btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 12px 28px;
}

/* (Lab app UIs are now in /labs/lab-style.css) */

/* ─── Report ──────────────────────────────────────────────────────────── */

.report-card h2 { font-family: var(--font-secondary); font-size: 1.2rem; margin-bottom: 20px; }

.report-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(111, 203, 243, 0.08);
}

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

.report-section h3 {
  font-family: var(--font-primary);
  font-size: 0.88rem;
  color: var(--bug-green);
  margin-bottom: 10px;
}

.report-section p, .report-section ol, .report-section li {
  color: var(--cipher-gray);
  font-size: 0.85rem;
}

.report-section ol { margin-left: 18px; }
.report-section li { margin-bottom: 6px; }

.report-input-group {
  background: var(--bg-secondary);
  border: 1px dashed rgba(111, 203, 243, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 8px 0;
}

.report-input-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--stealth-gray);
  margin-bottom: 6px;
}

.report-input {
  width: 100%;
  font-family: var(--font-primary);
  font-size: 0.82rem;
  background: var(--bg-input);
  color: var(--binary-blue);
  border: 1px solid rgba(111, 203, 243, 0.2);
  border-radius: 4px;
  padding: 8px 10px;
}

.report-input:focus { outline: none; border-color: var(--binary-blue); }

/* ─── Solved State ────────────────────────────────────────────────────── */

.solved-banner {
  display: none;
  background: rgba(105, 187, 83, 0.1);
  border: 1px solid rgba(105, 187, 83, 0.3);
  color: var(--bug-green);
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.solved-banner.visible { display: block; }

.lab-card.solved {
  border-color: rgba(105, 187, 83, 0.3);
}

.lab-card .solved-badge {
  display: none;
  margin-top: 10px;
}

.lab-card.solved .solved-badge {
  display: inline-block;
}

.report-input-wrap {
  position: relative;
}

.report-input-wrap .report-input { padding-right: 36px; }

.report-check {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.report-check.visible { opacity: 1; }
.report-check.pass { color: var(--bug-green); }
.report-check.fail { color: var(--critical-red); }

/* (Toasts and session info now live in lab apps) */

/* ─── Redacted / Final Challenge Card ────────────────────────────────── */

.badge-redacted {
  background: rgba(128, 128, 128, 0.25);
  color: var(--stealth-gray);
  border: 1px solid rgba(128, 128, 128, 0.4);
  letter-spacing: 2px;
}

.lab-card-redacted {
  border-color: rgba(128, 128, 128, 0.2);
  background: linear-gradient(135deg, var(--bg-card), #1a1a2e);
  cursor: default;
}

.lab-card-redacted:hover {
  border-color: rgba(128, 128, 128, 0.5);
}

/* ─── Confetti ────────────────────────────────────────────────────────── */

#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .page { padding: 80px 16px 32px; }
  .top-nav { padding: 14px 16px; }
  .nav-brand { font-size: 0.8rem; }
  .hero h1 { font-size: 1.6rem; }
  .labs-grid { grid-template-columns: 1fr; }
  .profile-details { grid-template-columns: 1fr; }
  .url-bar { flex-wrap: wrap; }
}
