/* Modern Networking Theme 2.0 - Premium Edition */
:root {
  --primary-bg: #020617;
  --secondary-bg: #0f172a;
  --accent-color: #3b82f6;
  --highlight-gold: #ffbd2e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --terminal-black: #000000;
  --container-width: 70vw;
}

body.light-mode {
  --primary-bg: #f8fafc;
  --secondary-bg: #ffffff;
  --accent-color: #2563eb;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(15, 23, 42, 0.08);
  --terminal-black: #0f172a;
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  font-size: 1.1rem;
}

.theme-toggle-btn:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
  .theme-toggle-btn {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    left: 12px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

body.light-mode .hero {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), #f1f5f9),
    url('https://images.unsplash.com/photo-1558494949-ef010cbdcc51?auto=format&fit=crop&q=80&w=2000');
  background-size: cover;
  background-position: center;
}

body.light-mode .hero h1 {
  background: linear-gradient(to right, #0f172a, var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-mode nav {
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

body.light-mode .lab-card,
body.light-mode .glass-panel,
body.light-mode .feature-item {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

body.light-mode .search-input {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #94a3b8;
}

body.light-mode footer {
  background: #e2e8f0;
  color: #475569;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

body.light-mode .terminal {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--primary-bg);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Navigation --- */
nav {
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 10000;
  padding: 0 40px;
  height: 70px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

nav a,
.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0 16px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

nav a:hover,
.nav-item:hover>a {
  color: var(--text-main);
}

/* Underline for top-level menu items */
nav>a::after,
nav>.nav-item>a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}

nav>a:hover::after,
nav>.nav-item:hover>a::after {
  transform: scaleX(1);
}

.nav-item i {
  margin-left: 10px;
  font-size: 0.7rem;
  transition: all 0.3s ease;
  color: var(--text-muted);
}

.nav-item:hover i {
  transform: rotate(180deg);
  color: var(--accent-color);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  height: 35vh;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 20px 20px;
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.7), var(--primary-bg)),
    url('https://images.unsplash.com/photo-1558494949-ef010cbdcc51?auto=format&fit=crop&q=80&w=2000');
  /* Datacenter Image */
  background-size: cover;
  background-position: center;
}

.hero-home {
  position: relative;
  height: 85vh;
  padding: 120px 20px 100px;
  background: transparent;
  overflow: hidden;
}

.hero-home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.6), var(--primary-bg)),
    url('https://images.unsplash.com/photo-1551434678-e076c223a692?q=80&w=2000');
  background-size: cover;
  background-position: center;
  filter: blur(6px);
  transform: scale(1.05);
  z-index: 1;
}

body.light-mode .hero-home::before {
  background-image: linear-gradient(to bottom, rgba(248, 250, 252, 0.6), var(--primary-bg)),
    url('https://images.unsplash.com/photo-1551434678-e076c223a692?q=80&w=2000');
}

.hero-home > * {
  position: relative;
  z-index: 2;
}

.hero-home+main {
  padding-top: 80px;
}

.hero-home+main section {
  margin-bottom: 150px;
}

.hero h1 {
  font-size: clamp(1.8rem, 8vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  background: linear-gradient(to right, #ffffff, var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
  padding: 0 10px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 600px;
}

/* --- Content Layout --- */
main,
.lab-main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 60px 40px;
  min-height: 60vh;
}

.blog-main {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 60px 40px;
  min-height: 60vh;
  font-size: 18px;
}

section {
  margin-bottom: 80px;
}

h2 {
  font-size: 2.2rem;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  letter-spacing: -0.5px;
}

.lab-main h2 {
  text-align: left;
  font-size: 1.6rem;
  border-left: 5px solid var(--accent-color);
  padding-left: 20px;
  margin: 60px 0 25px;
  background: transparent;
}

/* --- Individual Lab Header --- */
.lab-header-simple {
  padding: 120px 20px 40px;
  text-align: center;
  background: transparent;
}

.lab-header-simple h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text-main);
}

.capstone-header {
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  border-bottom: 3px solid #facc15;
}

.capstone-subtitle {
  color: #facc15;
  font-weight: 700;
  text-transform: uppercase;
}

body.light-mode .capstone-header {
  background: #ffffff;
}

body.light-mode .capstone-subtitle {
  color: var(--accent-color);
}

/* --- Footer --- */
footer {
  padding: 80px 40px;
  background: #020617;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.footer-content {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  text-align: left;
}

.footer-section h3 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-section p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--accent-color);
}

.contact-icons {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.contact-icons a {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.3s;
}

.contact-icons a:hover {
  background: var(--accent-color);
  transform: translateY(-3px);
}

.footer-bottom {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  text-align: center;
}

/* --- Download Broker (Toast Notification) --- */
#download-broker-overlay {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

#download-broker-overlay.active {
  transform: translateX(0);
}

.broker-card {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--accent-color);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  min-width: 320px;
  pointer-events: auto;
}

.broker-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-color);
  padding: 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.broker-content h4 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}

.broker-content p {
  margin: 4px 0 10px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.broker-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.broker-bar {
  width: 0%;
  height: 100%;
  background: var(--accent-color);
  transition: width 1.2s linear;
}

/* --- Dropdown Navigation --- */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: var(--secondary-bg);
  min-width: 200px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  z-index: 10002;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  top: 100%;
  left: 0;
  padding: 12px 0;
  text-align: left;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  display: block;
  pointer-events: none;
}

.dropdown-content a {
  display: block;
  padding: 10px 20px;
  text-transform: none;
  font-size: 0.85rem;
  letter-spacing: 0;
  height: auto;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.dropdown-content a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-color);
  padding-left: 25px;
}

.dropdown-content a::after {
  display: none !important;
}

.nav-item:hover .dropdown-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-item i {
  margin-left: 8px;
  font-size: 0.7rem;
  opacity: 0.7;
}

/* --- Unit Navigation (Vertical List) --- */
.unit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 900px;
  margin: 60px auto;
  padding: 0 20px;
}

.unit-item {
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  padding: 16px 24px;
  border-radius: 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.unit-item:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--accent-color);
  transform: translateX(8px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

.unit-icon-box {
  width: 42px;
  height: 42px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 1rem;
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.unit-item:hover .unit-icon-box {
  background: var(--accent-color);
  color: #fff;
  transform: scale(1.1);
}

.unit-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.unit-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.unit-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
  opacity: 0.8;
}

body.light-mode .unit-item {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
}

body.light-mode .unit-item:hover {
  background: #f8fafc;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

body.light-mode .unit-item p {
  color: #475569;
}

body.light-mode .dropdown-content {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .dropdown-content a {
  color: #334155;
}

body.light-mode .dropdown-content a:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* --- Featured Labs (Infinite Scroll) --- */
.labs-scroll-container {
  overflow: hidden;
  padding: 40px 0;
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  background: transparent;
}

.labs-scroll-container::before,
.labs-scroll-container::after {
  content: '';
  position: absolute;
  top: 0;
  width: 200px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.labs-scroll-container::before {
  left: 0;
  background: linear-gradient(to right, var(--primary-bg), transparent);
}

.labs-scroll-container::after {
  right: 0;
  background: linear-gradient(to left, var(--primary-bg), transparent);
}

.labs-track {
  display: flex;
  gap: 30px;
  width: max-content;
  animation: scroll 40s linear infinite;
}

.labs-track:hover {
  animation-play-state: paused;
}

.lab-item {
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  padding: 24px 30px;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 280px;
  flex-shrink: 0;
}

.lab-item:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-color);
  transform: translateY(-5px);
}

.lab-item span {
  color: var(--accent-color);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lab-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.4;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - 15px));
  }
}

/* --- Search UI (Hub Pages) --- */
.search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
}

.search-input {
  width: 100%;
  max-width: 600px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  padding: 18px 30px;
  border-radius: 50px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

/* --- Engineering Mastery (Feature Section) --- */
.feature-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 60px;
  margin-top: 100px;
}

.feature-text {
  flex: 1;
}

.feature-text span {
  color: var(--accent-color);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.feature-text h2 {
  text-align: left;
  margin: 10px 0 30px;
  font-size: 2.5rem;
}

.feature-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-item {
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  padding: 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
}

.feature-item i {
  width: 44px;
  height: 44px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.feature-item:hover {
  border-color: var(--accent-color);
  transform: translateX(10px);
}

/* --- Individual Lab Elements --- */
.lab-header {
  padding: 120px 20px 60px;
  text-align: center;
  background: transparent;
}

.lab-header h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 15px;
  letter-spacing: -1px;
}

.lab-header p {
  color: var(--accent-color);
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.9;
}

.lab-main h2 {
  text-align: left;
  font-size: 1.6rem;
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
  margin: 60px 0 25px;
  background: transparent;
  width: fit-content;
}

/* --- Premium Terminal (Lab Tasks) --- */
.terminal {
  background: #000000;
  border-radius: 12px;
  overflow: clip;
  margin: 30px 0 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.terminal-header {
  background: #1e293b;
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.red {
  background: #ff5f56;
  box-shadow: 0 0 5px rgba(255, 95, 86, 0.3);
}

.yellow {
  background: #ffbd2e;
  box-shadow: 0 0 5px rgba(255, 189, 46, 0.3);
}

.green {
  background: #27c93f;
  box-shadow: 0 0 5px rgba(39, 201, 63, 0.3);
}

.terminal pre {
  margin: 0;
  padding: 30px;
  color: #f8fafc;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre;
  word-wrap: normal;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terminal pre::-webkit-scrollbar {
  height: 5px;
}

.terminal pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.terminal pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}


.prompt {
  color: #4ade80;
  font-weight: 700;
  filter: drop-shadow(0 0 2px rgba(74, 222, 128, 0.3));
}

.command {
  color: #f8fafc;
}

/* --- Lab Resources Section --- */
.lab-resources {
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 45px;
  margin-top: 100px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
}

.resource-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.resource-col h3 {
  font-size: 1.15rem;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-weight: 700;
}

/* View Buttons (Blue) */
.view-btn {
  background: var(--accent-color);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.view-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.5);
  color: white;
  filter: brightness(1.1);
}

/* Download Buttons (Green) */
.download-btn {
  background: #10b981;
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.5);
  background: #059669;
  color: white;
  filter: brightness(1.1);
}

/* --- Navigation Button (Next Lab) --- */
.next-lab-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 60px;
  margin-bottom: 40px;
}

.next-lab-btn {
  background: var(--accent-color);
  color: white;
  padding: 16px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.next-lab-btn:hover {
  transform: translateX(8px);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
  color: white;
}

/* --- Image Containers --- */
.lab-image-box {
  background: #f8fafc;
  padding: 40px;
  border-radius: 20px;
  margin: 40px 0 60px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.lab-image-box img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.lab-image-box:hover img {
  transform: scale(1.02);
}

.lab-main ul {
  margin-bottom: 30px;
  padding-left: 20px;
}

.lab-main li {
  margin-bottom: 12px;
  color: var(--text-main);
}

body.light-mode .terminal-header {
  background: #cbd5e1;
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .lab-resources {
  background: #ffffff;
}

@media (max-width: 1000px) {
  .feature-section {
    flex-direction: column;
    text-align: center;
  }

  .feature-text h2 {
    text-align: center;
  }

  .feature-item {
    text-align: left;
  }
}

@media (max-width: 768px) {

  /* Allow nav items to be visible on mobile since there is no offcanvas */
  nav>a,
  nav>.nav-item {
    font-size: 0.75rem;
    padding: 0 8px;
  }

  /* Prevent dropdowns from overflowing the right edge of the screen */
  .dropdown-content {
    left: auto !important;
    right: 0 !important;
  }

  /* Keep nav bar at fixed height, no wrapping */
  nav {
    height: 70px !important;
    padding: 0 15px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important; /* Align to right so theme toggle on left doesn't overlap */
    gap: 5px !important;
  }

  /* Keep theme toggle on the left on mobile */
  .theme-toggle-btn {
    left: 12px !important;
    right: auto !important;
  }

  /* Lab resources: single column */
  .resource-grid {
    grid-template-columns: 1fr;
  }

  /* Footer: single column */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-icons {
    justify-content: center;
  }

  .terminal {
    width: 95% !important;
    margin: 30px auto !important;
    max-width: 100%;
  }

  .terminal pre {
    padding: 15px !important;
    font-size: 0.8rem !important;
  }

  /* Lab main content: full width on mobile */
  .lab-main,
  main,
  .blog-main {
    padding: 90px 16px 40px !important;
  }
}

@media (max-width: 768px) {
  :root {
    --container-width: 95vw;
  }
}

/* --- Blog Specific Premium Styles --- */
.blog-main {
  max-width: 1400px;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  margin: 40px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.comparison-table th {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-color);
  padding: 20px;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid var(--glass-border);
}

.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-main);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.mode-table {
  width: 100%;
  margin: 20px 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.mode-table th,
.mode-table td {
  padding: 12px 15px;
  text-align: left;
}

.mode-table th {
  color: var(--highlight-gold);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}

.tip-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
  border-left: 4px solid var(--accent-color);
  padding: 25px;
  border-radius: 0 16px 16px 0;
  margin: 40px 0;
}

.tip-box h4 {
  color: var(--accent-color);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
}

.trap-box {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
  border-left: 4px solid #ef4444;
  padding: 25px;
  border-radius: 0 16px 16px 0;
  margin: 40px 0;
}

.trap-box h4 {
  color: #ef4444;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
}

.verdict-box {
  background: var(--glass-bg);
  border: 1px solid var(--accent-color);
  padding: 30px;
  border-radius: 20px;
  margin: 50px 0;
  text-align: center;
}

.verdict-header {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.highlight {
  background: rgba(255, 189, 46, 0.1);
  padding: 20px;
  border-radius: 12px;
  margin: 30px 0;
  border: 1px dashed var(--highlight-gold);
}

body.light-mode .comparison-table {
  background: #ffffff;
}

body.light-mode .comparison-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

body.light-mode .verdict-box {
  background: #f8fafc;
}

body.light-mode .mode-table {
  background: rgba(0, 0, 0, 0.05);
}

/* --- ACL Lab: Topology Images --- */
.topology-container {
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 30px;
  margin: 20px 0 50px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.topology-img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  transition: transform 0.4s ease;
}

.topology-container:hover .topology-img {
  transform: scale(1.01);
}

body.light-mode .topology-container {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

/* --- ACL Lab: Topology Table --- */
.topology-table-wrapper {
  overflow-x: auto;
  margin: 20px 0 50px;
  border-radius: 16px;
}

.topology-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--secondary-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.topology-table th {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-color);
  padding: 16px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
}

.topology-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 0.92rem;
  vertical-align: middle;
}

.topology-table tr:last-child td {
  border-bottom: none;
}

.topology-table tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

body.light-mode .topology-table {
  background: #ffffff;
}

/* --- ACL Lab: Network Badges --- */
.badge-students {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-teachers {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-server {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-link {
  display: inline-block;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* --- ACL Lab: Info & Warning Boxes --- */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
  border-left: 4px solid var(--accent-color);
  padding: 22px 26px;
  border-radius: 0 14px 14px 0;
  margin: 10px 0 50px;
  color: var(--text-main);
  font-size: 0.93rem;
  line-height: 1.6;
}

.info-box>i {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Main title of the info box - stays as a block */
.info-box > div > strong:first-child {
  display: block;
  margin-bottom: 5px;
}

/* All strong tags in info-box (including inline) - get color and size */
/* ROLLBACK: merge these back into one '.info-box strong { display: block; ... }' */
.info-box strong {
  color: var(--accent-color);
  font-size: 0.95rem;
}

.warning-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
  border-left-color: #f59e0b;
}

.warning-box>i {
  color: #f59e0b;
}

.warning-box strong {
  color: #f59e0b;
}

body.light-mode .info-box {
  background: rgba(59, 130, 246, 0.06);
}

body.light-mode .warning-box {
  background: rgba(245, 158, 11, 0.07);
}

/* ─── Script Viewer Modal ─────────────────────────────────────── */
.script-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.script-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.script-modal-box {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.script-modal-overlay.active .script-modal-box {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.script-modal-header {
  background: #161b22;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.script-modal-dots {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

.script-modal-title {
  flex: 1;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  letter-spacing: 0.3px;
}

.script-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.script-modal-copy {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.script-modal-copy:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(59, 130, 246, 0.6);
}

.script-modal-copy.copied {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.script-modal-close {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.script-modal-close:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Modal Content Body */
.script-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.script-modal-body::-webkit-scrollbar {
  width: 6px;
}

.script-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.script-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

#script-modal-content {
  margin: 0;
  color: #e6edf3;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.88rem;
  line-height: 1.75;
  white-space: pre;
  overflow-x: auto;
}

/* Light mode */
body.light-mode .script-modal-box {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .script-modal-header {
  background: #e2e8f0;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .script-modal-title {
  color: #64748b;
}

body.light-mode #script-modal-content {
  color: #1e293b;
}

body.light-mode .script-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

/* --- Sticky Table of Contents --- */
.toc-sidebar {
  position: fixed;
  top: 100px;
  left: 3%;
  width: 14%;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.toc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.toc-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.toc-sidebar h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--highlight-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc-sidebar ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.toc-sidebar li {
  margin-bottom: 10px;
  line-height: 1.4;
}

.toc-sidebar li.toc-h3 {
  padding-left: 15px;
  font-size: 0.9rem;
}

.toc-sidebar a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.95rem;
}

.toc-sidebar a:hover {
  color: var(--accent-color);
}

/* Hide TOC on smaller screens */
@media (max-width: 1400px) {
  .toc-sidebar {
    display: none;
  }
}

/* --- Floating Topology Diagram --- */
.floating-topology-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  z-index: 9999;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-topology-btn:hover {
  transform: translateY(-2px);
  background: #2563eb;
}

.floating-topology-modal {
  position: fixed;
  bottom: 80px;
  right: 30px;
  width: 400px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s, visibility 0.2s;
}

.floating-topology-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.floating-modal-header {
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--glass-border);
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  font-weight: 600;
  color: var(--text-main);
}

.floating-modal-header:active {
  cursor: grabbing;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s;
}

.close-modal-btn:hover {
  color: #ef4444;
}

.floating-modal-content {
  padding: 10px;
  max-height: 400px;
  overflow: hidden;
}

.floating-modal-content img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}