/* ===============================
   Root Variables (Enhanced Theming)
================================ */

:root {
  --primary:       #2563eb;       /* main blue */
  --primary-dark:  #1d4ed8;
  --success:       #10b981;
  --bg-page: #f3f6fb;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-light: #6b7280;

  --brand-primary: #1e40af;
  --brand-dark: #0f172a;
  --brand-accent: #1e3a8a;
  --brand-light: #3b82f6;

  --success-green: #00ff66;
  --success-dark: #00cc52;
  --warning-bg: #fff7ed;
  --warning-border: #f97316;
  --warning-text: #7c2d12;
  
  --info-bg: #f0f9ff;
  --info-border: #0284c7;
  --info-text: #075985;

  --border-soft: #e5e7eb;
  --border-medium: #d1d5db;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ===============================
   Base Page Styling
================================ */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.75;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main reading container */
.container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 32px 28px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

/* ===============================
   Layout Structure from HTML
================================ */

.ad-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

.wrapper {
  width: 100%;
}

/* ─────── Headings ─────── */
h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.025em;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 5px;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.35s ease;
}

h1:hover::after {
  width: 110px;
}

h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 8px;
  position: relative;
  display: inline-block;
}

h2::before {
  content: '◆';
  position: absolute;
  left: -28px;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: bold;
  top: 4px;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

h2:hover::after {
  width: 100%;
}

h3 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 4px;
  position: relative;
  display: inline-block;
}

/* ===============================
   Paragraphs & Lists
================================ */

p {
  font-size: 1rem;
  margin: 14px 0 20px;
  color: var(--text-main);
  line-height: 1.7;
}

p strong {
  color: #020617;
  font-weight: 700;
}

ul {
  padding-left: 22px;
  margin: 14px 0 24px;
}

ul li {
  margin-bottom: 8px;
  color: var(--text-main);
  line-height: 1.6;
}

/* ===============================
   Preformatted Text Blocks
================================ */

pre {
  background: #f8fafc;
  border-left: 4px solid var(--brand-primary);
  padding: 16px 20px;
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 18px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-main);
  box-shadow: var(--shadow-inner);
}

/* Regular pre (non-terminal) styling */
pre:not(.cisco-terminal) {
  background: #f8fafc;
  color: var(--text-main);
  border-left: 4px solid var(--brand-primary);
}

/* ===============================
   Inline Code (Commands / Keywords)
================================ */

code {
  background: #f1f5f9;
  color: var(--brand-dark);
  padding: 3px 7px;
  border-radius: 5px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid #e2e8f0;
}

/* ===============================
   Cisco IOS Terminal (BLACK + GREEN)
================================ */

.cisco-terminal {
  background: #000000;
  color: var(--success-green);
  padding: 18px 20px;
  border-radius: 10px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 22px 0 6px;
  border-left: 6px solid var(--success-green);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 102, 0.25);
  white-space: pre;
  word-wrap: normal;
}

/* Reduce gap between h2 and Cisco terminal */
h2 + .cisco-terminal {
  margin-top: 0px;
}
.highlight-box {
  display: inline-block;
  border: 2px solid #ffffff;
  padding: 6px 8px;
  margin: 4px 0;
  box-shadow: 0 0 6px rgba(255,255,255,0.6);
}


/* ===============================
   Cisco Terminal Selection Fix
================================ */

.cisco-terminal::selection {
  background: rgba(0, 255, 102, 0.25);
  color: #00ff66;
}

.cisco-terminal ::selection {
  background: rgba(0, 255, 102, 0.25);
  color: #00ff66;
}

.cisco-terminal::-moz-selection {
  background: rgba(0, 255, 102, 0.25);
  color: #00ff66;
}

.cisco-terminal ::-moz-selection {
  background: rgba(0, 255, 102, 0.25);
  color: #00ff66;
}

/* ===============================
   Content Sections
================================ */

.section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
}

section {
  margin: 30px 0;
}

/* ===============================
   Best Practices Box
================================ */

.best-practices {
  background: var(--info-bg);
  border-left: 6px solid var(--info-border);
  padding: 24px 26px;
  margin: 34px 0;
  border-radius: 10px;
  box-shadow: var(--shadow-medium);
}

.best-practices h2 {
  margin-top: 0;
  border: none;
  padding-left: 0;
  color: var(--info-text);
}

/* ===============================
   Tables
================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 30px;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

table th {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
}

table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-main);
}

table tr:nth-child(even) td {
  background: #f8fafc;
}

table tr:hover td {
  background: #f1f5f9;
}

/* ===============================
   Warning Message
================================ */

.warning {
  background: var(--warning-bg);
  border-left: 6px solid var(--warning-border);
  padding: 16px 20px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--warning-text);
  margin: 22px 0;
  box-shadow: var(--shadow-medium);
}

.warning strong {
  color: var(--warning-text);
}

/* ===============================
   Images & Captions
================================ */

img {
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-soft);
  display: block;
}

.caption {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

/* ===============================
   Buttons
================================ */

.btn {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.btn:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}

.btn:focus {
  outline: 3px solid rgba(30, 64, 175, 0.4);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(0);
}

/* ===============================
   Footer Styles (from external CSS)
================================ */

#main-footer {
  background: var(--brand-dark);
  color: #ffffff;
  padding: 40px 0;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer-title {
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.svg-button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.svg-button:hover {
  transform: translateY(-2px);
}

.footer-copy {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #cbd5e1;
  opacity: 0.8;
}

/* ===============================
   Advanced Enhancements Layer
================================ */

/* ---------- Reading Comfort ---------- */

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--brand-primary),
    var(--brand-accent)
  );
  border-radius: 12px 12px 0 0;
}

/* ---------- Scrollbar Styling ---------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--brand-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-accent);
}

/* ---------- Selection Styling ---------- */

::selection {
  background: rgba(30, 64, 175, 0.2);
  color: var(--text-main);
}

::-moz-selection {
  background: rgba(30, 64, 175, 0.2);
  color: var(--text-main);
}

/* ---------- Focus Styling ---------- */

:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ===============================
   Animated White Underline for Terminal
================================ */

/* Wrapper to allow underline inside pre */
.underline-wrap {
  display: inline-block;
  position: relative;
}

/* The text itself */
.underline-text {
  color: #00ff66;  /* green terminal text */
  font-weight: 600;
  position: relative;
  z-index: 2;
}

/* Animated white underline */
.underline-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: #ffffff;
  animation: underline-anim 1s forwards;
  animation-delay: 0.5s;
  z-index: 1;
}

@keyframes underline-anim {
  from { width: 0; }
  to { width: 100%; }
}

/* Special styling for underline inside Cisco terminal */
.cisco-terminal .underline-wrap::after {
  bottom: 0;
}

/* ===============================
   Responsive Design
================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 1.9rem;
  }

  h2 {
    font-size: 1.15rem;
    margin-top: 36px;
    padding-left: 12px;
  }

  h3 {
    font-size: 1.15rem;
  }

  .container {
    padding: 22px 16px;
    margin: 20px auto;
    border-radius: 8px;
  }

  .cisco-terminal,
  pre {
    padding: 14px 16px;
    font-size: 0.9rem;
    margin: 16px 0;
  }

  table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
  }

  .social-buttons {
    flex-direction: column;
    align-items: center;
  }

  .svg-button {
    width: 200px;
    text-align: center;
    margin: 5px 0;
  }

  .best-practices,
  .warning {
    padding: 18px 20px;
    margin: 24px 0;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.7rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  body {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .container {
    padding: 16px 12px;
    margin: 10px;
  }

  .footer-inner {
    padding: 0 12px;
  }
}

/* ===============================
   Print Styles
================================ */

@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .container {
    box-shadow: none;
    border: 1px solid #ddd;
    margin: 0;
    padding: 20px;
  }

  .btn,
  .social-buttons,
  #main-footer {
    display: none;
  }

  /* ─────── Headings ─────── */
h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.025em;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 5px;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.35s ease;
}

h1:hover::after {
  width: 110px;
}

h2 {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 32px;
  position: relative;
  display: inline-block;
}

h2::before {
  content: '◆';
  position: absolute;
  left: -28px;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: bold;
  top: 4px;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

h2:hover::after {
  width: 100%;
}

h3 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-title);
  margin: 48px 0 24px;
}

  a {
    color: black;
    text-decoration: underline;
  }

  .cisco-terminal {
    background: white;
    color: black;
    border: 1px solid #ccc;
    border-left: 6px solid #333;
  }
  
  /* ===============================
   Closing p-tight
================================ */
  .p-tight {
  margin: 0 0 2px 0;
}
.pre-tight {
  margin-top: 2px;
}
.terminal-label {
  margin-bottom: 6px;   /* space ABOVE terminal */
}

.cisco-terminal {
  margin-top: 6px;      /* space BELOW label */
}

}
