@import url("../style.css");

/* =========================================================
   CISCO LAB & MARKDOWN VIEWER RETRO THEME
   ========================================================= */

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  margin: 0;
  padding: 18px 14px 60px;
  background:
    radial-gradient(circle at 15% 10%, #3fae4f 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, #3fae4f 0%, transparent 40%),
    #1e5c30;
  font-family: var(--font-txt);
  color: var(--c-paper);
}

.cisco-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================================================
   HEADER BANNER
   ========================================================= */
.cisco-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: linear-gradient(#20384a, #162432);
  border: 4px solid var(--c-border);
  box-shadow: 0 0 0 3px var(--c-paper), 0 0 0 6px var(--c-border), 0 10px 24px rgba(0,0,0,.5);
  padding: 16px 20px;
  width: 100%;
}

.cisco-title-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cisco-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cisco-badge {
  font-family: var(--font-px);
  font-size: 8px;
  background: var(--c-red);
  color: var(--c-white);
  padding: 4px 8px;
  letter-spacing: 1px;
  border: 2px solid rgba(0,0,0,.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cisco-badge.badge-blue {
  background: var(--c-sky-dark);
}

.cisco-badge.badge-gold {
  background: #d49a12;
  color: #fff;
}

.cisco-badge.badge-green {
  background: #27813a;
  color: #fff;
}

.cisco-head h1 {
  font-family: var(--font-px);
  font-size: clamp(12px, 2.8vw, 17px);
  color: var(--c-yellow);
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--c-border-dark);
  margin: 2px 0;
}

.cisco-head p {
  font-family: var(--font-txt);
  font-size: 21px;
  color: #b0d4f1;
  line-height: 1.2;
}

.cisco-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-back-menu {
  background: linear-gradient(#ffb703, #d98218) !important;
  color: #fff !important;
  border: 3px solid var(--c-border) !important;
  box-shadow: 0 4px 0 var(--c-border-dark) !important;
  text-shadow: 1px 1px 0 rgba(0,0,0,.4);
  font-family: var(--font-px) !important;
  font-size: 9px !important;
  letter-spacing: 1px;
}

.btn-back-menu:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.btn-back-menu:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--c-border-dark) !important;
}

/* =========================================================
   SEARCH & FILTER BAR
   ========================================================= */
.cisco-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(32, 56, 74, 0.95);
  border: 3px solid var(--c-border);
  padding: 10px 14px;
  box-shadow: 0 4px 0 rgba(0,0,0,.35);
}

.cisco-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--c-white);
  background: #2a475d;
  border: 2px solid var(--c-border);
  padding: 7px 10px;
  cursor: pointer;
  transition: all .1s;
}

.filter-btn:hover {
  background: var(--c-sky);
  color: var(--c-dark);
}

.filter-btn.active {
  background: var(--c-yellow);
  color: var(--c-dark);
  border-color: #9c6c10;
  box-shadow: inset 0 0 0 1px #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #121f2a;
  border: 2px solid var(--c-border);
  padding: 4px 10px;
  min-width: 240px;
}

.search-box span {
  font-family: var(--font-px);
  font-size: 9px;
  color: var(--c-yellow);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-txt);
  font-size: 19px;
  color: var(--c-paper);
  width: 100%;
}

.search-box input::placeholder {
  color: #698b9e;
}

/* =========================================================
   TWO-COLUMN MAIN GRID LAYOUT
   ========================================================= */
.cisco-main-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 880px) {
  .cisco-main-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   SIDEBAR (TUTORIAL CATALOG & STEP NAVIGATOR)
   ========================================================= */
.cisco-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-box {
  background: var(--c-paper);
  color: var(--c-ink);
  border: 4px solid var(--c-border);
  box-shadow: 0 0 0 2px var(--c-white), 0 0 0 5px var(--c-border), 0 10px 20px rgba(0,0,0,.45);
}

.sidebar-title {
  background: var(--c-sky-dark);
  color: var(--c-white);
  border-bottom: 3px solid var(--c-border);
  padding: 10px 14px;
  font-family: var(--font-px);
  font-size: 9px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
}

/* Custom scrollbar */
.sidebar-content::-webkit-scrollbar,
.doc-content::-webkit-scrollbar {
  width: 8px;
}
.sidebar-content::-webkit-scrollbar-track,
.doc-content::-webkit-scrollbar-track {
  background: #ecd493;
}
.sidebar-content::-webkit-scrollbar-thumb,
.doc-content::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border: 1px solid var(--c-border-dark);
}

/* Tutorial Cards in List */
.tutorial-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #fdfaf0;
  border: 2px solid var(--c-border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all .12s;
  position: relative;
}

.tutorial-card:hover {
  background: #ffeaa7;
  transform: translateX(4px);
  border-color: var(--c-red);
}

.tutorial-card.active {
  background: #eaf6ff;
  border: 3px solid var(--c-sky-dark);
  box-shadow: 3px 3px 0 var(--c-border);
  transform: translateX(4px);
}

.tutorial-card.active::before {
  content: "▶";
  position: absolute;
  left: -12px;
  top: 10px;
  color: var(--c-yellow);
  font-size: 10px;
  font-family: var(--font-px);
  text-shadow: 1px 1px 0 #000;
}

.tut-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.tut-badge {
  font-family: var(--font-px);
  font-size: 7px;
  background: var(--c-sky-dark);
  color: #fff;
  padding: 2px 5px;
}

.tut-meta {
  font-family: var(--font-txt);
  font-size: 15px;
  color: #7a6344;
}

.tut-title {
  font-family: var(--font-px);
  font-size: 9px;
  line-height: 1.4;
  color: var(--c-dark);
  margin-top: 2px;
}

.tut-desc {
  font-family: var(--font-txt);
  font-size: 16px;
  color: #634a31;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* TOC Steps list */
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fbf5e2;
  border: 1px solid #d5c08d;
  font-family: var(--font-txt);
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
  color: var(--c-ink);
  transition: all .1s;
}

.toc-item:hover {
  background: #ffe394;
  border-color: var(--c-border);
}

.toc-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-grass-dark);
  cursor: pointer;
}

.toc-item.completed {
  opacity: 0.65;
  text-decoration: line-through;
  background: #e6f4dd;
}

.toc-num {
  font-family: var(--font-px);
  font-size: 7px;
  background: var(--c-dark);
  color: var(--c-yellow);
  padding: 2px 4px;
  min-width: 18px;
  text-align: center;
}

/* Custom MD Uploader Box */
.upload-btn-wrap {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
}

.upload-btn-wrap input[type="file"] {
  position: absolute;
  left: 0; top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* =========================================================
   MAIN VIEWPORT & MARKDOWN DOCUMENT AREA
   ========================================================= */
.cisco-viewer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.doc-window {
  background: var(--c-paper);
  color: var(--c-ink);
  border: 4px solid var(--c-border);
  box-shadow: 0 0 0 3px var(--c-white), 0 0 0 6px var(--c-border), 0 14px 35px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  position: relative;
}

.doc-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c-sky-dark);
  border-bottom: 4px solid var(--c-border);
  padding: 12px 16px;
  color: var(--c-white);
  flex-wrap: wrap;
  gap: 8px;
}

.doc-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-led {
  width: 10px;
  height: 10px;
  background: #56d364;
  border-radius: 50%;
  border: 2px solid #0e3f14;
  box-shadow: 0 0 8px #56d364;
  animation: pulse-led 2s infinite ease-in-out;
}

@keyframes pulse-led {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.doc-window-title {
  font-family: var(--font-px);
  font-size: 10px;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--c-border);
}

.doc-head-controls {
  display: flex;
  gap: 6px;
}

/* Progress Tracker Bar */
.progress-container {
  background: #233b4e;
  border-bottom: 3px solid var(--c-border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-label {
  font-family: var(--font-px);
  font-size: 8px;
  color: var(--c-yellow);
  letter-spacing: 1px;
}

.progress-bar-outer {
  flex: 1;
  min-width: 140px;
  height: 14px;
  background: #111a21;
  border: 2px solid var(--c-border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
  position: relative;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3fae4f, #86d85f);
  box-shadow: 0 0 6px #86d85f;
  transition: width .3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.progress-pct {
  font-family: var(--font-px);
  font-size: 8px;
  color: #fff;
}

/* Document Body / Content */
.doc-content {
  padding: 24px 28px;
  font-family: var(--font-txt);
  font-size: 21px;
  line-height: 1.5;
  color: var(--c-ink);
  overflow-wrap: break-word;
}

@media (max-width: 600px) {
  .doc-content {
    padding: 16px 14px;
    font-size: 19px;
  }
}

/* =========================================================
   MARKDOWN ELEMENTS STYLING (SAFE & BEAUTIFUL)
   ========================================================= */

.doc-content h1 {
  font-family: var(--font-px);
  font-size: clamp(13px, 2.8vw, 18px);
  color: var(--c-dark);
  border-bottom: 4px solid var(--c-border);
  padding-bottom: 10px;
  margin-top: 10px;
  margin-bottom: 16px;
  letter-spacing: 1px;
  line-height: 1.4;
}

.doc-content h2 {
  font-family: var(--font-px);
  font-size: clamp(11px, 2.2vw, 14px);
  color: #173f63;
  background: #ebf3f9;
  border-left: 6px solid var(--c-sky-dark);
  border-top: 2px solid #bcd7ec;
  border-right: 2px solid #bcd7ec;
  border-bottom: 2px solid #bcd7ec;
  padding: 10px 14px;
  margin-top: 28px;
  margin-bottom: 14px;
  letter-spacing: 1px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-content h3 {
  font-family: var(--font-px);
  font-size: clamp(9px, 1.8vw, 11px);
  color: #723414;
  margin-top: 20px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.doc-content p {
  margin-bottom: 14px;
}

.doc-content hr {
  border: none;
  border-top: 3px dashed var(--c-border);
  margin: 24px 0;
  opacity: 0.6;
}

.doc-content blockquote {
  border-left: 5px solid var(--c-orange);
  background: #fbf2dc;
  padding: 12px 16px;
  margin: 16px 0;
  color: #553313;
  box-shadow: 2px 2px 0 rgba(0,0,0,.1);
}

.doc-content blockquote strong {
  color: #8c3b06;
}

.doc-content ul, .doc-content ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.doc-content li {
  margin-bottom: 6px;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: var(--font-txt);
  font-size: 19px;
  background: #fff;
  border: 3px solid var(--c-border);
  box-shadow: 3px 3px 0 rgba(0,0,0,.2);
}

.doc-content th {
  background: #253a4b;
  color: var(--c-yellow);
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 10px 12px;
  text-align: left;
  border: 2px solid var(--c-border);
}

.doc-content td {
  padding: 8px 12px;
  border: 1px solid #d8caad;
}

.doc-content tr:nth-child(even) {
  background: #f9f4e6;
}

.doc-content tr:hover {
  background: #fff0c7;
}

/* Inline Code */
.doc-content code:not(pre code) {
  background: #203545;
  color: #ffd43b;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 16px;
  padding: 2px 6px;
  border: 1px solid var(--c-border);
  border-radius: 2px;
}

/* =========================================================
   CISCO CLI TERMINAL CODE BLOCKS
   ========================================================= */
.cisco-terminal-wrap {
  margin: 18px 0;
  border: 3px solid var(--c-border);
  box-shadow: 4px 4px 0 rgba(0,0,0,.3);
  background: #111a21;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1c2b37;
  border-bottom: 2px solid var(--c-border);
  padding: 6px 12px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  color: #a4cde8;
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.copy-btn {
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--c-white);
  background: #244b6e;
  border: 2px solid var(--c-border);
  padding: 4px 8px;
  cursor: pointer;
  transition: all .1s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background: var(--c-sky);
  color: var(--c-dark);
}

.copy-btn:active {
  transform: translateY(1px);
}

.cisco-code-pre {
  margin: 0;
  padding: 14px 16px;
  background: #0f1820;
  color: #64e374;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.cisco-code-pre::-webkit-scrollbar {
  height: 6px;
}
.cisco-code-pre::-webkit-scrollbar-thumb {
  background: #2b455c;
}

/* Syntax colors inside cisco pre */
.cli-prompt { color: #ffd43b; font-weight: bold; }
.cli-keyword { color: #64e374; font-weight: bold; }
.cli-param { color: #72c8ff; }
.cli-comment { color: #8799a8; font-style: italic; }

/* =========================================================
   RAW MARKDOWN VIEW
   ========================================================= */
.raw-markdown-area {
  display: none;
  width: 100%;
  min-height: 480px;
  background: #111a21;
  color: #e5f1fa;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 16px;
  border: 3px solid var(--c-border);
  box-sizing: border-box;
  resize: vertical;
}

/* =========================================================
   FOOTER / STATUS BAR
   ========================================================= */
.doc-window-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 4px solid var(--c-border);
  background: #eadfbf;
  padding: 10px 16px;
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 1px;
  color: #6b6147;
  flex-wrap: wrap;
  gap: 10px;
}

.foot-buttons {
  display: flex;
  gap: 8px;
}

/* =========================================================
   TOAST NOTIFICATION
   ========================================================= */
.cisco-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--c-dark);
  color: var(--c-yellow);
  font-family: var(--font-px);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 12px 18px;
  border: 3px solid var(--c-white);
  box-shadow: 0 0 0 3px var(--c-border), 0 8px 24px rgba(0,0,0,.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: all .2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: none;
}

.cisco-toast.show {
  opacity: 1;
  transform: translateY(0);
}
