/* CCNA Standalone CME VoIP Lab Companion CSS Stylesheet */
:root {
  --bg-darker: #05070f;
  --bg-dark: #090c17;
  --bg-card: rgba(15, 22, 42, 0.6);
  --bg-card-hover: rgba(24, 34, 64, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(6, 182, 212, 0.6);
  
  --text-main: #f8fafc;
  --text-muted: #64748b;
  --text-secondary: #94a3b8;
  --text-inverse: #0f172a;
  
  --primary: #a855f7; /* VoIP Lab theme: vibrant purple */
  --primary-hover: #9333ea;
  --primary-glow: rgba(168, 85, 247, 0.2);
  
  --secondary: #3b82f6;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.15);
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
}

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

body {
  background-color: var(--bg-darker);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Sidebar styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-dark);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 10;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

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

.logo-text p {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.1rem;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

.menu-item {
  width: 100%;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.menu-item.active .menu-link {
  background: var(--primary-glow);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  padding-left: 0.8rem;
}

.menu-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.sidebar-progress {
  margin-top: auto;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-check-item {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-check-item.completed {
  color: var(--success);
}

.progress-check-item span.indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.progress-check-item.completed span.indicator {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.export-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.export-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.45);
}

/* Main workspace */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  height: 100vh;
}

.main-header {
  background: rgba(9, 12, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title h1 {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.student-meta {
  display: flex;
  gap: 1rem;
}

.student-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.student-input-group label {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.student-field {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  outline: none;
  width: 160px;
  transition: all 0.2s ease;
}

.student-field:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Tabs */
.tab-panel {
  display: none;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  animation: tabFadeIn 0.25s ease;
}

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

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

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

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
}

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

.card-title-text {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

/* SVG Topo */
.scenario-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
}

@media (max-width: 1200px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}

.map-container {
  background: radial-gradient(circle at center, rgba(13, 17, 36, 0.9) 0%, rgba(4, 6, 15, 1) 100%);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
  padding: 0.5rem;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topology-svg {
  width: 100%;
  height: auto;
}

.topology-link {
  stroke: #475569;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.topology-link.trunk {
  stroke: #38bdf8;
  stroke-dasharray: 4 4;
}

.topology-node {
  cursor: pointer;
  transition: all 0.2s ease;
}

.topology-node:hover .node-glow {
  stroke: var(--primary);
  fill: rgba(168, 85, 247, 0.1);
}

.topology-node.active .node-glow {
  stroke: var(--primary);
  fill: var(--primary-glow);
  filter: drop-shadow(0 0 8px var(--primary));
}

.node-label {
  fill: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.subnet-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  text-anchor: middle;
  font-family: var(--font-mono);
}

/* Planner & assignments tables */
.planner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.planner-table th {
  background: rgba(255,255,255,0.01);
  color: var(--primary);
  font-weight: 700;
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.planner-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.planner-input {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  outline: none;
  width: 100%;
  transition: all 0.2s ease;
}

.planner-input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.05);
}

.planner-input.correct {
  border-color: var(--success);
  box-shadow: 0 0 6px var(--success-glow);
  background: rgba(16, 185, 129, 0.02);
}

.planner-input.incorrect {
  border-color: var(--error);
  box-shadow: 0 0 6px var(--error-glow);
  background: rgba(239, 68, 68, 0.02);
}

.planner-readonly {
  font-family: var(--font-mono);
  font-weight: bold;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 0.7rem;
}

.status-badge.correct {
  background: var(--success-glow);
  color: var(--success);
}

.status-badge.incorrect {
  background: var(--error-glow);
  color: var(--error);
}

.verify-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.action-btn {
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 12px var(--primary-glow);
}

.validation-alert {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.validation-alert.success { color: var(--success); }
.validation-alert.error { color: var(--error); }
.validation-alert.info { color: var(--warning); }

/* Locks */
.locked-container {
  position: relative;
  min-height: 280px;
}

.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 15, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.lock-icon-wrapper {
  width: 64px;
  height: 64px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
  margin-bottom: 1.25rem;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.locked-overlay h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.locked-overlay p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.5;
}

/* Device grids */
.ip-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.ip-device-card {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.ip-device-card h4 {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
  padding-bottom: 0.4rem;
}

.ip-field-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.ip-field-row:last-child {
  margin-bottom: 0;
}

.ip-field-label-container {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ip-field-bound-text {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.65rem;
}

/* CLI styling */
.cli-generator-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .cli-generator-layout {
    grid-template-columns: 1fr;
  }
}

.cli-devices-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cli-menu-btn {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.cli-menu-btn:hover {
  background: rgba(255,255,255,0.03);
  color: #fff;
}

.cli-menu-btn.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary);
}

.ios-terminal-wrapper {
  background: #02040a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.terminal-header {
  background: rgba(12, 17, 34, 0.95);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-header span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.copy-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary);
}

.terminal-code-area {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: #cbd5e1;
  max-height: 420px;
  overflow-y: auto;
}

.terminal-code-area code {
  white-space: pre;
}

.terminal-code-area .cmd-cmt { color: #5c6c7d; font-style: italic; }
.terminal-code-area .cmd-kw { color: #c084fc; font-weight: bold; }
.terminal-code-area .cmd-val { color: #60a5fa; font-weight: bold; }

.device-detail-box {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Checklist Phase items */
.checklist-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.check-phase-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}

.check-phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.check-phase-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
}

.check-phase-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  text-transform: uppercase;
}

.check-phase-badge.completed {
  background: var(--success-glow);
  color: var(--success);
}

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

.check-step-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.check-step-cb {
  margin-top: 0.15rem;
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--primary);
}

.step-hint {
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid var(--primary);
  padding: 0.5rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  color: var(--text-secondary);
}

.step-hint code {
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.3);
  padding: 0.05rem 0.2rem;
  border-radius: 3px;
  color: var(--primary);
}

/* Architecture Selection Buttons */
.arch-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-main) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

.arch-btn.active {
  background: var(--primary-glow) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.25);
}

/* Certificate details */
#certificatePrintTemplate {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  #certificatePrintTemplate, #certificatePrintTemplate * {
    visibility: visible;
  }
  #certificatePrintTemplate {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: block !important;
    background: #fff;
    color: #0f172a;
    padding: 2rem;
  }
  
  .cert-border-outer {
    border: 8px double #a855f7;
    padding: 3rem;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .cert-content {
    max-width: 800px;
    margin: 0 auto;
  }

  .cert-badge-gold {
    width: 80px;
    height: 80px;
    background: #a855f7;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
  }

  .cert-title {
    font-size: 2.75rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #6b21a8;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
  }

  .cert-subtitle {
    font-size: 1.25rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
  }

  .cert-p {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 1rem;
  }

  .cert-name {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    text-decoration: underline;
    margin-bottom: 0.5rem;
  }

  .cert-id {
    font-size: 0.85rem;
    font-weight: 700;
    color: #a855f7;
    letter-spacing: 1px;
    margin-bottom: 2.5rem;
  }

  .cert-achievement {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 3.5rem;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 0;
  }

  .cert-footer-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 1rem;
  }

  .cert-sign-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
  }

  .cert-sign-title {
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
  }

  .cert-sign-val {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #0f172a;
  }

  .cert-hash {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-top: 3rem;
    font-family: var(--font-mono);
  }
}
