:root {
  --bg-primary: #070d19;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.2);
  --accent-gold-hover: #d97706;
  
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.15);
  --color-error: #ef4444;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-light: rgba(148, 163, 184, 0.08);
  --border-focus: rgba(245, 158, 11, 0.4);
  --border-glow: 0 0 15px rgba(245, 158, 11, 0.15);
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Cyber Backdrop Net */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(15, 23, 42, 0.9) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.9) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  top: -30%; left: -20%; width: 80%; height: 80%;
  background: radial-gradient(circle, rgba(30, 58, 138, 0.15) 0%, rgba(7, 13, 25, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--accent-gold-hover);
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Layout Content Panels */
.main-dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

header {
  grid-column: 1 / -1;
  background-color: rgba(7, 13, 25, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text h1 span {
  color: var(--accent-gold);
}

.logo-text p {
  font-size: 0.7rem;
  font-family: var(--font-display);
  letter-spacing: 2px;
  color: var(--text-secondary);
  font-weight: 600;
}

.user-progress-panel {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 180px;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-gold) 0%, var(--color-success) 100%);
  border-radius: 3px;
  transition: width 0.5s ease-in-out;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-hover) 100%);
  color: #000;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, #fbbf24 0%, var(--accent-gold) 100%);
}

.btn-primary:disabled {
  background: var(--text-muted);
  color: var(--bg-primary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Sidebar navigation */
.sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.25rem;
  height: calc(100vh - 120px);
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nav-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  gap: 0.75rem;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--accent-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item.completed {
  border-color: rgba(16, 185, 129, 0.2);
}

.nav-item.completed .status-dot {
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.nav-item.active .status-dot {
  background-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

.sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  margin-top: 1rem;
}

.sidebar-user {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Welcome Page (Cover Screen) */
.welcome-screen {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  min-height: calc(100vh - 150px);
}

.welcome-card {
  max-width: 650px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  box-shadow: var(--border-glow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-title {
  font-size: 2.25rem;
  color: var(--text-primary);
  font-weight: 800;
}

.welcome-title span {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-desc {
  color: var(--text-secondary);
  line-height: 1.6;
}

.input-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 0.5rem;
  margin-top: 1rem;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
}

.input-field:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

/* Course Content Area */
.course-pane {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: calc(100vh - 120px);
  position: relative;
  overflow-y: auto;
}

.module-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.module-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.module-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 1px;
}

.module-title {
  font-size: 1.85rem;
  font-weight: 800;
}

.module-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.module-illustration {
  width: 100%;
  height: auto;
  aspect-ratio: 1672 / 941;
  max-height: 280px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  margin-bottom: 0.5rem;
}

.module-body p strong {
  color: var(--text-primary);
}

.key-takeaways {
  background-color: rgba(30, 41, 59, 0.4);
  border-left: 3px solid var(--accent-gold);
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1rem;
}

.key-takeaways h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.key-takeaways ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.key-takeaways li {
  font-size: 0.95rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.key-takeaways li::before {
  content: '✓';
  color: var(--accent-gold);
  font-weight: bold;
}

/* Interactive Simulator Labs */
.simulator-lab {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.sim-badge {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
}

.sim-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sim-instruction {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Lab 1 (Prompt Sanitizer) Styles */
.prompt-box {
  background-color: #070d19;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: monospace;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.maskable-word {
  background-color: rgba(239, 68, 110, 0.15);
  border-bottom: 2px solid var(--color-error);
  padding: 0.1rem 0.25rem;
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.maskable-word:hover {
  background-color: rgba(239, 68, 110, 0.3);
}

.maskable-word.masked {
  background-color: var(--color-success-glow);
  border-bottom-color: var(--color-success);
  color: var(--color-success);
}

.maskable-word.masked::after {
  content: ' [REDACTED]';
  font-size: 0.75rem;
  font-weight: bold;
}

/* Lab 2 (Document Classifier) Styles */
.classifier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.classifier-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.class-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.9rem;
}

.class-card:hover {
  border-color: var(--accent-gold);
  background-color: rgba(245, 158, 11, 0.05);
}

.class-card.selected {
  border-color: var(--accent-gold);
  background-color: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

.classifier-targets {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.target-bucket {
  border: 2px dashed var(--border-light);
  background-color: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  gap: 0.5rem;
}

.target-bucket.drag-over {
  border-color: var(--accent-gold);
  background-color: rgba(245, 158, 11, 0.05);
}

.target-bucket h5 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.target-bucket.bucket-safe h5 {
  color: var(--color-success);
}

.target-bucket.bucket-sensitive h5 {
  color: var(--color-error);
}

.bucket-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
}

.bucket-item {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
}

.bucket-safe .bucket-item {
  border-color: rgba(16, 185, 129, 0.2);
}

.bucket-sensitive .bucket-item {
  border-color: rgba(239, 68, 68, 0.2);
}

/* Lab 3 (Email Inspector) Styles */
.email-client {
  background-color: #070d19;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.email-meta {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  background-color: rgba(255,255,255,0.01);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.email-meta div strong {
  color: var(--text-primary);
}

.email-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.email-flag {
  background-color: transparent;
  border-bottom: 2px dashed var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.email-flag:hover {
  background-color: rgba(245, 158, 11, 0.1);
  border-bottom-color: var(--accent-gold);
}

.email-flag.found {
  background-color: var(--color-success-glow);
  border-bottom: 2px solid var(--color-success);
  color: var(--color-success);
  padding: 0.1rem 0.25rem;
  border-radius: 2px;
}

.flag-counter {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 0.5rem;
}

/* Lab 4 (Deepfake Analyzer) Styles */
.audio-simulation {
  background-color: #070d19;
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
}

.play-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--accent-gold);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 1.2rem;
  border: none;
}

.play-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--accent-gold);
}

.wave-animation {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  height: 30px;
}

.wave-bar {
  flex: 1;
  height: 4px;
  background-color: var(--text-muted);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.wave-animation.playing .wave-bar {
  background-color: var(--accent-gold);
  animation: waveGlow 1.2s ease-in-out infinite alternate;
}

.wave-animation.playing .wave-bar:nth-child(2n) { animation-delay: 0.1s; }
.wave-animation.playing .wave-bar:nth-child(3n) { animation-delay: 0.2s; }
.wave-animation.playing .wave-bar:nth-child(4n) { animation-delay: 0.3s; }
.wave-animation.playing .wave-bar:nth-child(5n) { animation-delay: 0.4s; }

@keyframes waveGlow {
  0% { height: 4px; }
  100% { height: 28px; }
}

.verdict-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Lab 5 (Flowchart Tool Approval) Styles */
.flow-tree {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.flow-node {
  background-color: #070d19;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.25rem;
}

.flow-question {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.flow-options {
  display: flex;
  gap: 0.75rem;
}

.flow-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.flow-btn:hover, .flow-btn.selected {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background-color: rgba(245, 158, 11, 0.05);
}

/* Lab 6 (Mock Incident Form) Styles */
.sim-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 1rem;
}

.sim-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.sim-input, .sim-select, .sim-textarea {
  background-color: #070d19;
  border: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  border-radius: 6px;
  outline: none;
  font-size: 0.9rem;
}

.sim-textarea {
  min-height: 80px;
  resize: vertical;
  font-family: var(--font-body);
}

.sim-input:focus, .sim-select:focus, .sim-textarea:focus {
  border-color: var(--accent-gold);
}

/* Simulator Feedback UI */
.sim-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.sim-feedback.success {
  background-color: var(--color-success-glow);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--text-primary);
  display: block;
}

.sim-feedback.error {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--text-primary);
  display: block;
}

.sim-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* Knowledge Check Quiz Styles */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.quiz-question-card {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-q-num {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.quiz-q-text {
  font-size: 1.1rem;
  font-weight: 600;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background-color: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quiz-option:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255,255,255,0.2);
}

.quiz-option.selected {
  border-color: var(--accent-gold);
  background-color: rgba(245, 158, 11, 0.05);
}

.quiz-option.correct {
  border-color: var(--color-success);
  background-color: var(--color-success-glow);
}

.quiz-option.incorrect {
  border-color: var(--color-error);
  background-color: rgba(239, 68, 68, 0.1);
}

.quiz-option input[type="radio"] {
  margin-right: 1rem;
  accent-color: var(--accent-gold);
}

/* Certificate Area */
.certificate-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.certificate-card {
  width: 100%;
  aspect-ratio: 1.414 / 1; /* Standard A4 landscape ratio */
  background: radial-gradient(circle at center, #111a2e 0%, #070d19 100%);
  border: 15px double var(--accent-gold);
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--border-glow);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

/* Ornamental corners */
.cert-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent-gold);
  z-index: 5;
}
.cert-corner-tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.cert-corner-tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.cert-corner-bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.cert-corner-br { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.cert-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.cert-logo {
  height: 50px;
  margin-bottom: 0.5rem;
}

.cert-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 4px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
}

.cert-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  margin-top: 1rem;
}

.cert-title span {
  color: var(--accent-gold);
}

.cert-award {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  margin: 1rem 0;
}

.cert-recipient {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  border-bottom: 2px solid var(--accent-gold);
  padding: 0 2rem 0.5rem 2rem;
  min-width: 250px;
}

.cert-course {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-top: 1rem;
  font-weight: 600;
  max-width: 600px;
}

.cert-footer-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  margin-top: 2rem;
}

.cert-footer-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 200px;
}

.cert-sig-line {
  border-top: 1px solid var(--text-secondary);
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cert-date {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}

.cert-seal {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, #fbbf24 0%, var(--accent-gold-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  border: 2px dashed #000;
  color: #000;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  line-height: 1.1;
  transform: rotate(-10deg);
}

.cert-verify-id {
  position: absolute;
  bottom: 12px;
  left: 20px;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: monospace;
}

.cert-disclaimer {
  position: absolute;
  bottom: 12px;
  right: 20px;
  font-size: 0.55rem;
  color: var(--text-muted);
  max-width: 300px;
  text-align: right;
  line-height: 1.2;
}

.cert-actions {
  display: flex;
  gap: 1rem;
}

/* Call to Action Resources Card */
.resources-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 2rem;
}

.resources-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.resources-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Global Footer */
footer {
  grid-column: 1 / -1;
  background-color: #030712;
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-disclaimer {
  max-width: 800px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(255, 255, 255, 0.01);
  padding: 1rem;
  border-radius: 6px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .main-dashboard {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .sidebar {
    height: auto;
    position: static;
    padding: 0.75rem;
    display: block;
  }

  .nav-title {
    display: none;
  }

  .nav-list {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .sidebar-footer {
    display: none;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .user-progress-panel {
    justify-content: space-between;
  }
  
  .welcome-card {
    padding: 1.5rem;
  }
  
  .classifier-grid {
    grid-template-columns: 1fr;
  }
  
  .verdict-choices {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .cert-footer-layout {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  
  .cert-verify-id, .cert-disclaimer {
    position: static;
    margin-top: 1rem;
    text-align: center;
  }
  
  .resources-card {
    flex-direction: column;
    text-align: center;
  }
}

/* Print CSS override for Certificate */
@media print {
  @page {
    size: landscape;
    margin: 0;
  }
  
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
    overflow: hidden !important;
    background-color: #070d19 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body::before, body::after {
    display: none !important;
    content: none !important;
  }

  /* Hide everything except the certificate and its ancestry tree */
  #welcome-screen,
  header,
  .sidebar,
  .module-header,
  .module-body > p,
  .resources-card,
  .cert-actions,
  footer {
    display: none !important;
  }

  /* Reset layout constraints on ancestors to prevent pagination/height overflows */
  .main-dashboard,
  .course-pane,
  #module-7-view,
  .module-body {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  /* Style certificate wrapper to fill page and center the card */
  .certificate-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100vw !important;
    height: 100vh !important;
    padding: 3.5rem !important; /* Nice buffer zone to ensure borders are not cut off by printer margin */
    box-sizing: border-box !important;
    background: transparent !important;
  }

  .certificate-card {
    width: 100% !important;
    height: 100% !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    aspect-ratio: 1.414 / 1 !important;
    margin: auto !important;
    border: 12px double #d97706 !important;
    background: radial-gradient(circle at center, #111a2e 0%, #070d19 100%) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    position: relative !important;
  }
}
