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

:root {
  --primary-color: #0d1117;
  --secondary-color: #00d9ff;
  --accent-color: #ff6b9d;
  --bg-color: #0f0f0f;
  --text-color: #c9d1d9;
  --border-color: #30363d;
  --code-bg: #0d1117;
  --success-color: #3fb950;
  --warning-color: #d29922;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.8;
  color: #c9d1d9;
  background-color: #0a0a0a;
  font-size: 16px;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 90%;
  margin: 0 auto;
  padding: 20px;
  background-color: #0f0f0f;
  color: #c9d1d9;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  flex: 1;
  width: 90%;
}

/* Header Styles */
h1 {
  color: #00d9ff;
  border: none;
  margin: 0 0 10px 0;
  padding: 0;
}

h2 {
  color: var(--secondary-color);
  border-left: 4px solid var(--secondary-color);
  padding-left: 15px;
  margin: 40px 0 20px 0;
  font-size: 1.8em;
}

h3 {
  color: var(--secondary-color);
  margin: 20px 0 10px 0;
  font-size: 1.4em;
}

h4 {
  color: var(--secondary-color);
  margin: 15px 0 5px 0;
  font-size: 1.2em;
}

/* Navigation */
.navigation {
  background-color: var(--primary-color);
  color: white;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border: 1px solid #30363d;
}

.navigation strong {
  margin-right: 10px;
  color: #00d9ff;
}

.navigation a {
  text-decoration: none;
  padding: 8px 12px;
  background-color: var(--secondary-color);
  border-radius: 3px;
  transition: all 0.3s;
  font-size: 0.9em;
  color: #0d1117;
  font-weight: 600;
}

.navigation a:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

/* Part Links */
.part-links {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.part-links strong {
  color: var(--accent-color);
  margin-right: 10px;
}

.part-links a {
  color: var(--text-color);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.part-links a:hover {
  background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
  border-color: #00d9ff;
}

.part-links a.active-part {
  background: linear-gradient(135deg, #00d9ff 0%, #00a8cc 100%);
  color: white;
  border-color: #00d9ff;
  box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  color: #0d1117;
  padding: 40px 20px;
  margin: 20px 0;
  border-radius: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.1) 0%,
    rgba(255, 107, 157, 0.1) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-section h1 {
  border: none;
  font-size: 2.8em;
  margin: 0 0 10px 0;
  color: #00d9ff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.2em;
  color: #ff6b9d;
  margin: 0 0 15px 0;
  font-weight: 600;
}

.hero-description {
  font-size: 1em;
  color: #c9d1d9;
  margin: 0 0 20px 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-badge {
  background: rgba(0, 217, 255, 0.2);
  color: #00d9ff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid rgba(0, 217, 255, 0.3);
  backdrop-filter: blur(5px);
}

/* Download Button Styles */
.download-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #28a745;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  margin: 5px;
  transition: all 0.3s ease;
}

.download-btn:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.download-btn.btn-current {
  background: #3498db;
  color: white;
}

.download-btn.btn-current:hover {
  background: #2980b9;
}


/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.card {
  background: #161b22;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 25px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--secondary-color);
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
  transform: translateY(-5px);
}

.card h3 {
  margin-top: 0;
  color: var(--secondary-color);
  font-size: 1.4em;
}

.card-number {
  display: inline-block;
  background: var(--secondary-color);
  color: #0d1117;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  font-weight: bold;
  margin-bottom: 10px;
}

.card-desc {
  color: var(--text-color);
  margin: 10px 0;
  font-size: 0.9em;
  line-height: 1.4;
}

.card-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.card-list li {
  color: var(--text-color);
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
  margin: 5px 0;
  line-height: 1.4;
}

.card-list li:before {
  content: "▸ ";
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

.card-btn {
  display: inline-block;
  background: var(--secondary-color);
  color: #0d1117;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 15px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.card-btn:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 20px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--secondary-color),
    var(--accent-color)
  );
  border-radius: 2px;
  transition: width 0.5s ease;
  animation: progressPulse 2s infinite;
}

@keyframes progressPulse {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* TOC Container */
.toc-container {
  background: #161b22;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  margin: 30px 0;
  max-height: 400px;
  overflow-y: auto;
}

.toc-container h2 {
  color: var(--secondary-color);
  margin-top: 0;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.toc-item {
  background: var(--bg-color);
  border-left: 4px solid var(--secondary-color);
  padding: 20px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.toc-item:hover {
  background: rgba(0, 217, 255, 0.1);
  border-left-color: var(--accent-color);
  transform: translateX(5px);
}

.toc-item h3 {
  color: var(--secondary-color);
  margin-top: 0;
  font-size: 1.2em;
}

.toc-item ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
}

.toc-item li {
  color: var(--text-color);
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
  margin: 5px 0;
  line-height: 1.4;
}

.toc-item li:before {
  content: "▸ ";
  position: absolute;
  left: 0;
  color: var(--accent-color);
}

.toc-item a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.toc-item a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.section-number {
  display: inline-block;
  background: var(--secondary-color);
  color: #0d1117;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-weight: bold;
  margin-right: 10px;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 30px 0;
}

.feature {
  background: var(--bg-color);
  border-left: 4px solid var(--secondary-color);
  padding: 15px;
  border-radius: 5px;
}

.feature h4 {
  margin-top: 0;
  color: var(--secondary-color);
}

.feature p {
  font-size: 0.9em;
  color: var(--text-color);
  margin: 5px 0;
}

/* Info Box */
.info-box {
  background: var(--bg-color);
  border-left: 4px solid var(--secondary-color);
  padding: 20px;
  border-radius: 5px;
  margin: 20px 0;
}

.info-box h3 {
  color: var(--secondary-color);
  margin-top: 0;
}

.info-box ul {
  margin-left: 20px;
  color: var(--text-color);
}

.info-box li {
  margin: 8px 0;
  line-height: 1.4;
}

/* Content Sections */
.content {
  flex: 1;
  width: 100%;
}

/* Search Results */
.search-results {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 20px;
  margin: 20px 0;
  max-height: 400px;
  overflow-y: auto;
}


/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .card {
    padding: 15px;
  }

  .toc-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .toc-item {
    padding: 15px;
  }
}

/* Download Section */
.download-section {
  background: linear-gradient(135deg, #00d9ff 0%, #ff6b9d 100%);
  color: #0d1117;
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.download-section h3 {
  color: #0d1117;
  margin-top: 0;
}

.download-section p {
  margin-bottom: 15px;
  color: #0d1117;
}

.download-btn {
  display: inline-block;
  background-color: #0d1117;
  color: #00d9ff;
  padding: 10px 20px;
  border-radius: 3px;
  text-decoration: none;
  margin-right: 10px;
  margin-bottom: 10px;
  font-weight: bold;
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid #00d9ff;
  font-size: 0.95em;
}

.download-btn:hover {
  background-color: #00d9ff;
  color: #0d1117;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 217, 255, 0.3);
}

/* Section Index */
.section-index {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  padding: 30px;
  border-left: 5px solid #00d9ff;
  border-radius: 8px;
  margin-bottom: 40px;
  color: #c9d1d9;
  border: 2px solid #30363d;
  box-shadow: 0 5px 15px rgba(0, 217, 255, 0.1);
}

.section-index h3 {
  margin-top: 0;
  color: #00d9ff;
  font-size: 1.3em;
}

.section-index ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.section-index li {
  padding: 10px 15px;
  margin: 8px 0;
  background: #0d1117;
  border-radius: 5px;
  border-left: 3px solid #ff6b9d;
  transition: all 0.3s;
}

.section-index li:hover {
  background: #161b22;
  border-left-color: #00d9ff;
  padding-left: 20px;
  box-shadow: inset 0 0 10px rgba(0, 217, 255, 0.1);
}

.section-index a {
  color: #00d9ff;
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 500;
}

.section-index a:hover {
  color: #ff6b9d;
}

/* Table of Contents Level Styling */
.toc-level-2 {
  margin-left: 0;
  font-weight: 600;
}

.toc-level-3 {
  margin-left: 20px;
  font-weight: 400;
}

.toc-level-2 a,
.toc-level-3 a {
  color: #00d9ff;
  text-decoration: none;
  display: block;
  padding: 5px 0;
}

.toc-level-2 a:hover,
.toc-level-3 a:hover {
  color: #ff6b9d;
  text-decoration: underline;
}

/* Command Blocks */
.command-block {
  background-color: #0d1117;
  border-left: 4px solid #ff6b9d;
  padding: 15px;
  margin: 15px 0;
  border-radius: 5px;
  position: relative;
  transition: all 0.3s;
  color: #c9d1d9;
  border: 1px solid #30363d;
}

.command-block:hover {
  box-shadow: 0 5px 15px rgba(0, 217, 255, 0.2);
  border-left-color: #00d9ff;
}

.command-block h4 {
  margin-top: 0;
  color: #00d9ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.command-block pre {
  background-color: #05070d;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid #1a1d23;
  font-family: "Courier New", Courier, monospace;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-color);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.command-block code {
  font-family: "Courier New", monospace;
  font-size: 1.21em;
  color: #79c0ff;
  white-space: pre-wrap;
  background-color: transparent;
  padding: 2px 5px;
  border-radius: 3px;
}

/* Search Box (legacy .search-box used on some pages) */

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-box input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #30363d;
  border-radius: 5px;
  background: #0d1117;
  color: #c9d1d9;
  font-size: 14px;
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: #00d9ff;
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.2);
}

.search-box button {
  padding: 12px 20px;
  background-color: #00d9ff;
  color: #0d1117;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.search-box button:hover {
  background-color: #ff6b9d;
  color: white;
  transform: translateY(-2px);
}


/* Alert Boxes */
.warning {
  background-color: #3a3a1a;
  border-left: 4px solid #d29922;
  padding: 15px;
  margin: 20px 0;
  border-radius: 5px;
  color: #fbbf24;
}

.info {
  background-color: #1a2a3a;
  border-left: 4px solid #00d9ff;
  padding: 15px;
  margin: 20px 0;
  border-radius: 5px;
  color: #79c0ff;
}

.success {
  background-color: #1a3a1a;
  border-left: 4px solid #3fb950;
  padding: 15px;
  margin: 20px 0;
  border-radius: 5px;
  color: #3fb950;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background-color: #0d1117;
}

table th {
  background-color: #00d9ff;
  color: #0d1117;
  padding: 12px;
  text-align: left;
  font-weight: bold;
}

table td {
  padding: 10px 12px;
  border-bottom: 1px solid #30363d;
  color: #c9d1d9;
}

table tr:hover {
  background-color: #161b22;
}

.theme-toggle {
  z-index: 101;
  transition: all 0.3s;
  font-weight: 600;
}

.theme-toggle:hover {
  background-color: #ff6b9d;
  color: white;
}

/* Light Mode (Optional) */
body.light-mode {
  background-color: #f6f8fa;
  color: #24292f;
}

body.light-mode .container {
  background-color: #ffffff;
  color: #24292f;
}

body.light-mode .command-block {
  background-color: #f6f8fa;
  border-left-color: #00d9ff;
}

body.light-mode .command-block pre {
  background-color: #f6f8fa;
  color: #24292f;
  border-color: #d0d7de;
}

body.light-mode .navigation {
  background-color: #f6f8fa;
  border: 1px solid #d0d7de;
}

body.light-mode .section-index {
  background-color: #f6f8fa;
  color: #24292f;
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4 {
  color: #24292f;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    max-width: 90%;
    padding: 14px;
    margin: 0 auto;
    width: 90%;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.6em;
  }

  .navigation,
  .part-links {
    flex-direction: column;
    gap: 8px;
  }

  .navigation a,
  .part-links a {
    width: 100%;
    text-align: center;
    padding: 10px 12px;
  }

  /* Make long code lines wrap better and allow horizontal scroll when needed */
  .command-block pre {
    font-size: 0.95em;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .command-block code {
    font-size: 0.95em;
  }

  /* Make section index scrollable instead of pushing layout off-screen */
  .section-index {
    max-height: 260px;
    overflow-y: auto;
    padding: 16px;
  }

  table th,
  table td {
    font-size: 0.95em;
  }

  .theme-toggle {
    top: 12px;
    right: 12px;
    padding: 8px 10px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  .container {
    max-width: 90%;
    padding: 10px;
    margin: 0 auto;
    width: 90%;
  }

  h1 {
    font-size: 1.6em;
  }

  h2 {
    font-size: 1.25em;
  }

  body {
    font-size: 15px;
  }

  .navigation a,
  .part-links a {
    padding: 8px 10px;
    font-size: 0.95em;
  }

  /* Reduce command block padding to fit narrow screens */
  .command-block {
    padding: 10px;
  }

  .command-block pre {
    font-size: 0.85em;
  }

  /* Ensure tables and images fit the screen */
  table,
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

.highlight {
  background-color: #fbbf24;
  padding: 2px 5px;
}

/* Index Page Specific Styling */
body.index-page {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body.index-page .container {
  background: linear-gradient(
    135deg,
    rgba(26, 26, 46, 0.95) 0%,
    rgba(22, 33, 62, 0.95) 50%,
    rgba(15, 52, 96, 0.95) 100%
  );
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 217, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 217, 255, 0.15);
}

body.index-page h1 {
  background: linear-gradient(135deg, #00d9ff 0%, #ff6b9d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.index-page .hero-section {
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.1) 0%,
    rgba(255, 107, 157, 0.1) 100%
  );
  color: white;
  border: 1px solid rgba(0, 217, 255, 0.3);
  backdrop-filter: blur(5px);
}

body.index-page .card {
  background: rgba(26, 26, 46, 0.8);
  border: 1px solid rgba(0, 217, 255, 0.3);
  backdrop-filter: blur(5px);
}

body.index-page .card:hover {
  border-color: #00d9ff;
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.4);
  transform: translateY(-5px);
}

/* Other Pages Styling */
body:not(.index-page) {
  background-color: #0a0a0a;
}

body:not(.index-page) .container {
  background-color: #0f0f0f;
  border: 1px solid #1a1a1a;
}

body:not(.index-page) .command-block {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border: 1px solid #30363d;
}

body:not(.index-page) .command-block:hover {
  border-color: #00d9ff;
  box-shadow: 0 5px 15px rgba(0, 217, 255, 0.2);
}

/* Print Styles */
@media print {
  .navigation,
  .part-links,
  .download-section,
  .theme-toggle,
  .search-container {
    display: none !important;
  }

  .container {
    box-shadow: none;
    max-width: 100%;
  }

  .command-block {
    page-break-inside: avoid;
  }
}

/* Navigation Up/Down Buttons */
.navigation-buttons {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.nav-btn {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d9ff, #0099cc);
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
  backdrop-filter: blur(10px);
}

.nav-btn:hover {
  background: linear-gradient(135deg, #00ffff, #00b3e6);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 217, 255, 0.5);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-up {
  background: linear-gradient(135deg, #3fb950, #2ea043);
  box-shadow: 0 4px 15px rgba(63, 185, 80, 0.3);
}

.nav-up:hover {
  background: linear-gradient(135deg, #4ec960, #3fb950);
  box-shadow: 0 6px 20px rgba(63, 185, 80, 0.5);
}

.nav-down {
  background: linear-gradient(135deg, #ff6b9d, #ff4757);
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.nav-down:hover {
  background: linear-gradient(135deg, #ff8fab, #ff6b9d);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

/* Command Classification System Styles */
.command-category {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding: 8px 12px;
  background: rgba(13, 17, 23, 0.6);
  border-left: 4px solid #30363d;
  border-radius: 6px;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

.command-category:hover {
  background: rgba(13, 17, 23, 0.8);
  transform: translateX(5px);
}

.category-tag {
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 1.44em;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.category-description {
  color: #8b949e;
  font-size: 1.42em;
  opacity: 0.9;
}

/* Category Colors */
.category-common {
  background: linear-gradient(
    135deg,
    rgba(40, 167, 69, 0.2),
    rgba(40, 167, 69, 0.1)
  );
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.category-production {
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.2),
    rgba(255, 193, 7, 0.1)
  );
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.category-debug {
  background: linear-gradient(
    135deg,
    rgba(23, 162, 184, 0.2),
    rgba(23, 162, 184, 0.1)
  );
  color: #17a2b8;
  border: 1px solid rgba(23, 162, 184, 0.3);
}

.category-rare {
  background: linear-gradient(
    135deg,
    rgba(108, 117, 125, 0.2),
    rgba(108, 117, 125, 0.1)
  );
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.category-dangerous {
  background: linear-gradient(
    135deg,
    rgba(220, 53, 69, 0.25),
    rgba(220, 53, 69, 0.15)
  );
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.4);
  animation: pulse-category-danger 2s infinite;
}

.category-beginner {
  background: linear-gradient(
    135deg,
    rgba(23, 162, 184, 0.2),
    rgba(23, 162, 184, 0.1)
  );
  color: #17a2b8;
  border: 1px solid rgba(23, 162, 184, 0.3);
}

.danger {
  background: rgba(220, 53, 69, 0.1);
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  color: #dc3545;
}

.danger strong {
  color: #dc3545;
}

.category-danger {
  background: linear-gradient(
    135deg,
    rgba(220, 53, 69, 0.25),
    rgba(220, 53, 69, 0.15)
  );
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.4);
}

.category-advanced {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 157, 0.2),
    rgba(255, 107, 157, 0.1)
  );
  color: #ff6b9d;
  border: 1px solid rgba(255, 107, 157, 0.3);
}

.category-intermediate {
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.2),
    rgba(255, 193, 7, 0.1)
  );
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.category-security {
  background: linear-gradient(
    135deg,
    rgba(0, 217, 255, 0.2),
    rgba(0, 217, 255, 0.1)
  );
  color: #00d9ff;
  border: 1px solid rgba(0, 217, 255, 0.3);
}

/* Hover Effects for Category Tags */
.category-common:hover {
  background: linear-gradient(
    135deg,
    rgba(40, 167, 69, 0.3),
    rgba(40, 167, 69, 0.2)
  );
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.category-production:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 193, 7, 0.3),
    rgba(255, 193, 7, 0.2)
  );
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.category-debug:hover {
  background: linear-gradient(
    135deg,
    rgba(23, 162, 184, 0.3),
    rgba(23, 162, 184, 0.2)
  );
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.category-rare:hover {
  background: linear-gradient(
    135deg,
    rgba(108, 117, 125, 0.3),
    rgba(108, 117, 125, 0.2)
  );
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.category-dangerous:hover {
  background: linear-gradient(
    135deg,
    rgba(220, 53, 69, 0.35),
    rgba(220, 53, 69, 0.25)
  );
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(220, 53, 69, 0.5);
}

/* Animation for dangerous category */
@keyframes pulse-category-danger {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .command-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .category-tag {
    font-size: 1.35em;
  }

  .category-description {
    font-size: 1.27em;
  }

  .navigation-buttons {
    right: 15px;
  }

  .nav-btn {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}



@media (max-width: 480px) {
  .navigation-buttons {
    right: 10px;
  }

  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ============================
   LEARNING GUIDE ENHANCEMENTS
   ============================ */

/* Search Bar */
.search-container {
  background: linear-gradient(135deg, #0d1117 0%, #1a1f2e 100%);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.search-container h3 {
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1em;
}

.search-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 12px 18px;
  background: #0a0a0a;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 1em;
  font-family: 'Fira Code', 'Courier New', monospace;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

.search-input::placeholder {
  color: #484f58;
}

.search-clear-btn {
  padding: 12px 16px;
  background: rgba(220, 53, 69, 0.2);
  border: 2px solid #dc3545;
  border-radius: 8px;
  color: #dc3545;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: none;
}

.search-clear-btn:hover {
  background: rgba(220, 53, 69, 0.4);
  transform: scale(1.05);
}

.search-clear-btn:active {
  transform: scale(0.95);
}

.search-clear-btn.visible {
  display: block;
}

.search-results-container {
  margin-top: 15px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.search-results-container.visible {
  display: block;
}

.search-result-count {
  color: #8b949e;
  font-size: 0.9em;
  margin-bottom: 10px;
  padding: 5px 0;
}

.search-result-item {
  background: rgba(0, 217, 255, 0.05);
  border-left: 3px solid var(--secondary-color);
  padding: 12px 15px;
  margin: 8px 0;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-result-item:hover {
  background: rgba(0, 217, 255, 0.15);
  border-left-color: var(--accent-color);
  transform: translateX(5px);
}

.search-result-item .result-section {
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 0.95em;
}

.search-result-item .result-context {
  color: #8b949e;
  font-size: 0.85em;
  margin-top: 4px;
}

.search-result-item .result-context mark {
  background: rgba(255, 107, 157, 0.3);
  color: var(--accent-color);
  padding: 0 2px;
  border-radius: 2px;
}

.search-no-results {
  text-align: center;
  padding: 30px;
  color: #8b949e;
}

.search-no-results .no-results-icon {
  font-size: 2em;
  margin-bottom: 10px;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 18px;
  margin-bottom: 20px;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.breadcrumb-nav a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #484f58;
  margin: 0 3px;
}

.breadcrumb-current {
  color: var(--accent-color);
  font-weight: bold;
}

/* Progress Tracking */
.progress-bar-container {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #1a1f2e;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-text {
  color: var(--text-color);
  font-size: 0.85em;
  white-space: nowrap;
}

.progress-reset-btn {
  padding: 5px 12px;
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid #dc3545;
  border-radius: 5px;
  color: #dc3545;
  font-size: 0.8em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.progress-reset-btn:hover {
  background: rgba(220, 53, 69, 0.4);
}

/* TOC Progress Checkboxes */
.toc-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  vertical-align: middle;
  margin-right: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.toc-checkbox:checked {
  background: var(--success-color);
  border-color: var(--success-color);
}

.toc-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.toc-checkbox:hover {
  border-color: var(--secondary-color);
}

.section-index li.completed a {
  opacity: 0.6;
  text-decoration: line-through;
}

/* Prev/Next Section Navigation */
.section-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
  padding: 20px;
  background: linear-gradient(135deg, #0d1117 0%, #1a1f2e 100%);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  gap: 15px;
}

.section-nav-btn {
  display: flex;
  flex-direction: column;
  padding: 12px 20px;
  background: rgba(0, 217, 255, 0.1);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.3s ease;
  max-width: 45%;
  min-width: 120px;
}

.section-nav-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 217, 255, 0.2);
}

.section-nav-btn.next {
  text-align: right;
  margin-left: auto;
}

.section-nav-btn .nav-label {
  font-size: 0.8em;
  color: #8b949e;
  margin-bottom: 4px;
}

.section-nav-btn .nav-title {
  font-weight: bold;
  font-size: 0.95em;
}

.section-nav-center {
  color: var(--text-color);
  font-size: 0.85em;
  text-align: center;
  padding: 10px;
}

/* Collapsible TOC */
.toc-toggle-btn {
  background: rgba(0, 217, 255, 0.1);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--secondary-color);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.toc-toggle-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  border-color: var(--secondary-color);
}

.section-index.collapsed ul {
  display: none;
}

/* Highlight matched search terms in content */
.highlight-match {
  background: rgba(255, 107, 157, 0.3);
  color: var(--accent-color);
  padding: 1px 3px;
  border-radius: 2px;
}

/* Section jump indicator */
.section-flash {
  animation: sectionFlash 1s ease;
}

@keyframes sectionFlash {
  0% { background: rgba(0, 217, 255, 0.3); }
  100% { background: transparent; }
}

/* Dangerous command pulse — shared across all pages */
@keyframes pulse-danger {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0.15);
  }
}

/* Copy button — used inside .command-block */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 217, 255, 0.15);
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 10;
  letter-spacing: 0.5px;
}

.copy-btn:hover {
  background: var(--secondary-color);
  color: #0d1117;
  transform: scale(1.05);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn.copied {
  background: var(--success-color);
  border-color: var(--success-color);
  color: #0d1117;
}

/* ====================================
   ACCESSIBILITY — reduced motion
   ==================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
