@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;700;900&display=swap');

:root {
  --bg-dark: #070b19;
  --bg-card: rgba(13, 21, 39, 0.65);
  --bg-hover: rgba(20, 32, 59, 0.85);
  --primary: #00f0ff;
  --secondary: #bd00ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --glow-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  --glow-success: 0 0 15px rgba(16, 185, 129, 0.3);
  --glow-danger: 0 0 15px rgba(239, 68, 68, 0.3);
  --border-color: rgba(0, 240, 255, 0.2);
  --border-radius: 12px;
  --font-cyber: 'Orbitron', monospace;
  --font-main: 'Inter', sans-serif;
}

body.light-theme {
  --bg-dark: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-hover: rgba(241, 245, 249, 0.95);
  --primary: #0284c7;
  --secondary: #7c3aed;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: rgba(15, 23, 42, 0.15);
  --glow-shadow: 0 0 10px rgba(2, 132, 199, 0.15);
}

body.light-theme input[type="text"], 
body.light-theme input[type="password"], 
body.light-theme textarea, 
body.light-theme select {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

body.light-theme .email-client {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-theme .email-list {
  border-right-color: #cbd5e1;
  background: #f8fafc;
}
body.light-theme .email-item {
  border-bottom-color: #f1f5f9;
}
body.light-theme .email-item.active {
  background: rgba(2, 132, 199, 0.1);
}
body.light-theme .email-body {
  background: #ffffff;
}
body.light-theme .social-post {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-theme .traffic-stream-container {
  background: #f8fafc;
  border-color: #cbd5e1;
}
body.light-theme .rule-row {
  background: #ffffff;
  border-color: #e2e8f0;
}
body.light-theme .cipher-wheel {
  background: radial-gradient(circle, #f8fafc 20%, #e2e8f0 100%);
}
body.light-theme .wheel-inner {
  background: #ffffff;
}
body.light-theme .letter-pos {
  color: #0f172a;
}
body.light-theme .cipher-terminal {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-theme .result-box {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-theme .evidence-block {
  background: rgba(0, 0, 0, 0.03);
}
body.light-theme .progress-hud {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-theme .game-canvas {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-theme .challenge-box {
  background: #ffffff;
  border-color: #cbd5e1;
}
body.light-theme .challenge-item {
  background: #f8fafc;
}
body.light-theme .challenge-item.completed {
  background: rgba(16, 185, 129, 0.1);
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(189, 0, 255, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 240, 255, 0.1) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(13, 21, 39, 0.5) 0px, transparent 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  padding: 2rem 1rem;
}

header {
  max-width: 1200px;
  margin: 0 auto 3rem auto;
  text-align: center;
}

h1 {
  font-family: var(--font-cyber);
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 240, 255, 0.3));
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
}

/* Glassmorphism Container */
.cyber-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.3s ease;
}

.cyber-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 8px 32px 0 rgba(0, 240, 255, 0.1);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.module-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.7;
}

.module-card.completed::before {
  background: var(--success);
}

.module-badge {
  font-family: var(--font-cyber);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.module-title {
  font-family: var(--font-cyber);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.module-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.module-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.module-duration {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-cyber);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #00b0ff);
  color: #050510;
  box-shadow: var(--glow-shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: var(--glow-success);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: var(--glow-danger);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6);
}

/* Nav & Info elements */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-family: var(--font-cyber);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-link:hover {
  text-shadow: var(--glow-shadow);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-family: var(--font-cyber);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-shadow);
}

/* Game Interface specific styles */
.game-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .game-container {
    grid-template-columns: 2fr 1fr;
  }
}

.game-canvas {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  min-height: 450px;
  display: flex;
  flex-direction: column;
}

.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Password meter styling */
.strength-bar-container {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.crack-results {
  font-family: var(--font-cyber);
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.result-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.result-box .value {
  font-size: 1.25rem;
  font-weight: bold;
  margin-top: 0.5rem;
}

.result-box.instant .value { color: var(--danger); }
.result-box.secure .value { color: var(--success); }

/* Email simulator styling */
.email-client {
  display: grid;
  grid-template-columns: 250px 1fr;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 500px;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}

.email-list {
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  max-height: 520px;
}

.email-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.email-item:hover {
  background: rgba(255,255,255,0.03);
}

.email-item.active {
  background: rgba(0, 240, 255, 0.1);
  border-left: 3px solid var(--primary);
}

.email-item .sender {
  font-weight: bold;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item .subject {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item.completed-item {
  border-right: 4px solid var(--success);
}

.email-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: 520px;
  overflow-y: auto;
  background: rgba(0,0,0,0.1);
}

.email-header-info {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.email-header-info div {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.email-header-info span.header-label {
  color: var(--text-muted);
  font-weight: 500;
  display: inline-block;
  width: 60px;
}

.email-content {
  flex-grow: 1;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  border-radius: 6px;
  font-family: Arial, sans-serif;
  color: #1f2937;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.phishing-actions {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.phishing-buttons {
  display: flex;
  gap: 1rem;
}

/* OSINT / Social Media detective */
.social-feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.social-post {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 1rem;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  color: white;
}

.post-meta .author {
  font-weight: bold;
  font-size: 0.9rem;
}

.post-meta .time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-image {
  width: 100%;
  height: 200px;
  border-radius: 6px;
  margin-top: 0.75rem;
  border: 1px solid rgba(255,255,255,0.05);
  background-size: cover;
  background-position: center;
}

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

.tab {
  padding: 0.75rem 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-cyber);
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-shadow: var(--glow-shadow);
}

/* Caesar cipher wheel */
.cipher-wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 1.5rem 0;
}

.cipher-wheel {
  position: relative;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, #0d1527 20%, #152243 100%);
  border: 4px solid var(--primary);
  box-shadow: var(--glow-shadow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wheel-outer, .wheel-inner {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.wheel-inner {
  width: 75%;
  height: 75%;
  border: 2px dashed var(--secondary);
  background: #070b19;
}

.letter-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-pos {
  position: absolute;
  height: 90%;
  font-family: var(--font-cyber);
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--text-main);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.inner-letter-pos {
  position: absolute;
  height: 80%;
  font-family: var(--font-cyber);
  font-weight: bold;
  font-size: 0.8rem;
  color: var(--primary);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Courtroom case files */
.courtroom-evidence {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 1.5rem;
  height: 380px;
  overflow-y: auto;
  font-size: 0.95rem;
}

.case-file-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.evidence-block {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--secondary);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0 6px 6px 0;
}

/* Progress HUD styling */
.progress-hud {
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 1.5rem;
  font-family: var(--font-cyber);
  font-size: 0.85rem;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-label {
  color: var(--text-muted);
}

.hud-value {
  color: var(--primary);
  font-weight: bold;
}

/* Print Certificate Template styling (hidden on screen) */
#certificate-container {
  display: none;
}

@media print {
  body {
    background: white !important;
    background-image: none !important;
    color: black !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  header, main, nav, .nav-bar, .cyber-card, .game-container, .btn, .back-link, footer, .progress-hud {
    display: none !important;
  }
  
  #certificate-container {
    display: block !important;
    width: 100%;
    max-width: 750px;
    margin: 30px auto;
    padding: 35px;
    border: 8px double #1e293b;
    background: white;
    font-family: 'Times New Roman', Times, serif;
    color: #0f172a;
    text-align: center;
    box-sizing: border-box;
    box-shadow: none !important;
  }
  
  .cert-header {
    border-bottom: 2px solid #334155;
    padding-bottom: 15px;
    margin-bottom: 20px;
  }
  
  .cert-logo {
    font-family: 'Georgia', serif;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #1e293b;
    text-transform: uppercase;
  }
  
  .cert-title {
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 15px 0;
    color: #0f172a;
  }
  
  .cert-subtitle {
    font-size: 16px;
    font-style: italic;
    margin-bottom: 25px;
    color: #475569;
  }
  
  .cert-presented-to {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
  }
  
  .cert-student-name {
    font-size: 26px;
    font-weight: bold;
    text-decoration: underline;
    margin: 15px 0;
    color: #000;
  }
  
  .cert-body {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 0 30px;
    color: #334155;
  }
  
  .cert-score-box {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid #1e293b;
    background: #f8fafc;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 30px;
  }
  
  .cert-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 45px;
    font-family: sans-serif;
    font-size: 11px;
    border-top: 1px solid #cbd5e1;
    padding-top: 15px;
    color: #64748b;
  }
  
  .cert-stamp {
    font-weight: bold;
    color: #059669;
    border: 2px solid #059669;
    padding: 4px 8px;
    border-radius: 4px;
    transform: rotate(-3deg);
    font-size: 12px;
  }
}
