/* ========================================
   CTF PAGE VARIABLES
   ======================================== */

:root {
  --terminal-bg: #0d1117;
  --terminal-bg-light: #161b22;
  --terminal-blue: #58a6ff;
  --terminal-green: #3fb950;
  --terminal-yellow: #d29922;
  --terminal-red: #f85149;
  --terminal-purple: #a371f7;
  --terminal-gray: #8b949e;
  --terminal-text: #c9d1d9;
  --terminal-border: #30363d;
  --success: #3fb950;
  --error: #f85149;
  --warning: #d29922;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 8px;
}

/* ========================================
   BASE STYLES
   ======================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--terminal-bg);
  color: var(--terminal-text);
}

body {
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  min-height: 100vh;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

header {
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  border-bottom: 1px solid var(--terminal-border);
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
}

header nav ul li a {
  color: var(--terminal-text);
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  position: relative;
  padding: 5px 0;
  transition: var(--transition);
}

header nav ul li a:hover {
  color: var(--terminal-red);
}

header nav ul li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: var(--terminal-red);
  transition: var(--transition);
}

header nav ul li a:hover::after {
  width: 100%;
}

/* ========================================
   BINARY BACKGROUND
   ======================================== */

.binary-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 20px;
  color: rgba(163, 113, 247, 0.08);
  z-index: -2;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  transition: transform 0.3s ease-out;
}

/* ========================================
   SECURITY ICON
   ======================================== */

.security-icon {
  position: fixed;
  top: 20%;
  right: 10%;
  font-size: 4rem;
  opacity: 0.15;
  z-index: -1;
  animation: float 6s ease-in-out infinite;
  color: var(--terminal-purple);
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

/* ========================================
   CTF INTRO SECTION
   ======================================== */

.ctf-intro-section {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  color: var(--terminal-text);
  position: relative;
  overflow: hidden;
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 40vh;
  padding: 3rem 0;
}

.ctf-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ========================================
   TERMINAL CONTAINER
   ======================================== */

.terminal-container {
  background: rgba(22, 27, 34, 0.95);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  width: 90%;
  max-width: 900px;
  padding: 2.5rem;
  backdrop-filter: blur(10px);
  border: 1px solid var(--terminal-border);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--terminal-border);
}

.terminal-title {
  font-weight: bold;
  color: var(--terminal-red);
  font-size: 1.2rem;
}

.terminal-controls {
  display: flex;
  gap: 8px;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-body {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  line-height: 1.8;
}

.terminal-line {
  margin-bottom: 0.5rem;
  min-height: 1.8rem;
}

.prompt {
  color: var(--terminal-green);
  margin-right: 0.5rem;
  font-weight: bold;
}

.command {
  color: var(--terminal-yellow);
}

.output {
  color: var(--terminal-text);
  margin-left: 1.5rem;
}

.status-line {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--terminal-border);
}

.status {
  color: var(--terminal-yellow);
  font-style: italic;
}

/* ========================================
   CTF SECTIONS
   ======================================== */

.ctf-section {
  margin-bottom: 3rem;
}

.ctf-section.locked {
  opacity: 0.6;
  pointer-events: none;
}

.section-title {
  color: var(--terminal-red);
  margin-top: 0;
  margin-bottom: 2rem;
  font-size: 1.8rem;
  border-left: 4px solid var(--terminal-red);
  padding-left: 1rem;
}

.locked .section-title {
  color: var(--terminal-gray);
  border-left-color: var(--terminal-gray);
}

/* ========================================
   CHALLENGE CARDS
   ======================================== */

.challenge-card {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.challenge-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--terminal-blue);
}

.challenge-card.locked {
  border-color: var(--terminal-gray);
}

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

.difficulty {
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--terminal-bg);
}

.difficulty.easy {
  background: var(--terminal-green);
}

.difficulty.medium {
  background: var(--terminal-yellow);
}

.difficulty.hard {
  background: var(--terminal-red);
}

.challenge-status {
  font-size: 1.2rem;
}

.challenge-description {
  margin-bottom: 1.5rem;
  color: var(--terminal-text);
  font-size: 1.1rem;
}

.locked-message {
  background: rgba(139, 148, 158, 0.1);
  border: 1px dashed var(--terminal-gray);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.locked-message p {
  margin: 0;
  color: var(--terminal-gray);
}

/* ========================================
   LOGIN FORM
   ======================================== */

.challenge-form {
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: var(--terminal-blue);
  font-weight: 600;
}

.form-group input {
  padding: 10px;
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius);
  color: var(--terminal-text);
  font-family: 'Courier New', monospace;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--terminal-blue);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.form-hint {
  color: var(--terminal-gray);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.form-hint code {
  background: rgba(88, 166, 255, 0.1);
  color: var(--terminal-blue);
  padding: 2px 6px;
  border-radius: 4px;
}

.login-btn {
  background: var(--terminal-green);
  color: var(--terminal-bg);
  margin-top: 1rem;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.login-btn:hover {
  background: var(--terminal-yellow);
  color: var(--terminal-bg);
}

/* ========================================
   HINT SECTION
   ======================================== */

.hint-section {
  margin-top: 1rem;
}

.hint-details {
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 1rem;
}

.hint-details summary {
  color: var(--warning);
  cursor: pointer;
  font-weight: 600;
}

.hint-details summary:hover {
  color: var(--terminal-yellow);
}

.hint-details p {
  margin-top: 0.5rem;
  color: var(--terminal-text);
}

.hint-details code {
  background: rgba(210, 153, 34, 0.2);
  color: var(--warning);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ========================================
   CHALLENGE METADATA
   ======================================== */

.challenge-metadata {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--terminal-border);
  font-size: 0.9rem;
}

.challenge-metadata p {
  margin: 0.25rem 0;
  color: var(--terminal-gray);
}

.challenge-metadata strong {
  color: var(--terminal-blue);
}

/* ========================================
   MORE CHALLENGES
   ======================================== */

.more-challenges {
  text-align: center;
  padding: 3rem;
  background: rgba(22, 27, 34, 0.3);
  border-radius: var(--radius);
  border: 1px dashed var(--terminal-gray);
}

.more-challenges h3 {
  color: var(--terminal-yellow);
}

.more-challenges p {
  color: var(--terminal-gray);
}

/* ========================================
   VICTORY MODAL
   ======================================== */

.victory-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.victory-content {
  background: var(--terminal-bg-light);
  border: 3px solid var(--terminal-green);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(63, 185, 80, 0.4);
  max-width: 500px;