/* =========================================================
   DSA 25 Patterns Interactive Lab Styles
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #1e3a40 #060e12;
}

html.drawer-open,
body.drawer-open {
  overflow: hidden !important;
}

/* Global Dark Teal Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #060e12;
}

::-webkit-scrollbar-thumb {
  background: #1e3a40;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

header.dsa-header {
  padding: 16px 4vw;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 19, 22, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.header-actions-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #09171b;
  color: var(--accent-300);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-toggle-btn:hover {
  border-color: var(--primary);
  color: #fff;
  background: rgba(83, 142, 151, 0.2);
  box-shadow: 0 0 12px rgba(83, 142, 151, 0.25);
}

.sidebar-toggle-btn.active {
  background: rgba(83, 142, 151, 0.22);
  border-color: var(--primary);
  color: #fff;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-300);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #fff;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

header.dsa-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  overflow-wrap: anywhere;
}

header.dsa-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13.5px;
  max-width: 1100px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.layout {
  padding-top: 24px;
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: auto;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 110px);
}

aside {
  margin-right: 24px;
  border-radius: 24px 0 0 24px;
  width: 320px;
  min-width: 320px;
  flex-shrink: 0;
  padding: 16px;
  border: 1px solid var(--card-border);
  height: calc(100vh - 110px);
  position: sticky;
  top: 110px;
  overflow-y: auto;
  background: rgba(8, 14, 26, 0.6);
  transition: width 0.25s ease, min-width 0.25s ease, padding 0.25s ease, opacity 0.25s ease;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #23454b transparent;
}

aside::-webkit-scrollbar {
  width: 6px;
}

aside::-webkit-scrollbar-track {
  background: rgba(6, 15, 19, 0.4);
  border-radius: 6px;
}

aside::-webkit-scrollbar-thumb {
  background: #23454b;
  border-radius: 6px;
}

aside::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body.sidebar-collapsed aside {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border-right: none !important;
  overflow: hidden !important;
}

.aside-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(83, 142, 151, 0.15);
}

.aside-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-200);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.01em;
}

.aside-close-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.aside-close-btn:hover {
  color: #fff;
  background: rgba(83, 142, 151, 0.2);
  border-color: var(--card-border);
}

.aside-list {
  display: flex;
  flex-direction: column;
}

.search {
  width: 100%;
  padding: 10px 12px;
  background: #080e1a;
  border: 1px solid var(--card-border);
  color: #f1f5f9;
  border-radius: 8px;
  margin-bottom: 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(83, 142, 151, 0.25);
}

.group {
  margin: 14px 0 6px;
  color: var(--accent-300);
  font-weight: 650;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

aside button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

aside button:hover,
aside button.active {
  background: #0d1c22;
  color: #fff;
  border-left: 2px solid var(--primary);
}

.dsa-main .card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.5);
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: normal;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dsa-main .badge {
  display: inline-block;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 6px;
  background: var(--pill-bg);
}

.dsa-main .badge.easy {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.09);
}

.dsa-main .badge.medium {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.09);
}

.dsa-main .badge.hard {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.09);
}

.counter {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.problem-title {
  font-size: 22px;
  margin: 8px 0 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.problem-links {
  margin: 6px 0 0;
  font-size: 13.5px;
}

.problem-links a {
  color: var(--accent-300);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.problem-links a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Problem Statement Header & Copy Button */
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title-row h3 {
  margin: 0 !important;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0d1c22;
  color: var(--accent-300);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-copy:hover {
  border-color: var(--primary);
  color: #fff;
  background: rgba(83, 142, 151, 0.18);
  box-shadow: 0 0 12px rgba(83, 142, 151, 0.25);
}

.btn-copy.copied {
  background: rgba(52, 211, 153, 0.18);
  border-color: #34d399;
  color: #a7f3d0;
}

/* Problem Statement Rich Content */
.problem-statement {
  color: #cbd5e1;
  font-size: 14.5px;
  line-height: 1.7;
}

.problem-statement p {
  color: #cbd5e1;
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.problem-statement p:last-child {
  margin-bottom: 0;
}

.problem-statement strong,
.problem-statement b {
  color: #ffffff;
  font-weight: 600;
}

.problem-statement strong.example {
  display: block;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--accent-200);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.problem-statement pre {
  background: #05090f;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 10px 0 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #e2e8f0;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
}

.problem-statement code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(83, 142, 151, 0.14);
  color: var(--accent-200);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(83, 142, 151, 0.22);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.problem-statement pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.problem-statement pre strong {
  color: var(--accent-300);
}

.problem-statement ul {
  margin: 10px 0 16px 24px;
  padding-left: 4px;
  list-style-type: disc;
  max-width: 100%;
}

.problem-statement ul li {
  margin-bottom: 8px;
  line-height: 1.65;
  color: #cbd5e1;
  font-size: 14px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.problem-statement ul li:last-child {
  margin-bottom: 0;
}

.problem-statement ul li::marker {
  color: var(--accent-400);
}

.problem-statement sup,
.problem-statement sub {
  font-size: 11px;
  line-height: 0;
  color: var(--accent-300);
}

.problem-statement img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 18px auto;
  border-radius: 10px;
  background: #f8fafc;
  padding: 14px;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  object-fit: contain;
  box-sizing: border-box;
}

.problem-statement table {
  display: block;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.problem-statement th,
.problem-statement td {
  border: 1px solid var(--card-border);
  padding: 8px 12px;
  text-align: left;
}

.problem-statement th {
  background: rgba(83, 142, 151, 0.15);
  color: #fff;
}

.dsa-main .card h3,
.card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-200);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.dsa-main .card p,
.card p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 12px;
}

.dsa-main .card p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.dsa-main .card ol,
.card ol {
  margin: 12px 0 14px 28px;
  padding-left: 6px;
}

.dsa-main .card ol li,
.card ol li {
  margin-bottom: 10px;
  line-height: 1.65;
  color: #cbd5e1;
  font-size: 14px;
  padding-left: 4px;
}

.dsa-main .card ol li:last-child,
.card ol li:last-child {
  margin-bottom: 0;
}

.dsa-main .card ol li::marker,
.card ol li::marker {
  color: var(--accent-400);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 13px;
}

.dsa-main .card strong,
.card strong,
.dsa-main .card b,
.card b {
  color: #ffffff;
  font-weight: 600;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.node {
  background: #0e1d24;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--accent-300);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.arrow {
  color: var(--primary);
  font-weight: bold;
}

.array {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cell {
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border: 1px solid rgba(83, 142, 151, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080e1a;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-300);
  box-sizing: border-box;
}

.cell.active {
  background: rgba(41, 76, 82, 0.6);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(83, 142, 151, 0.35);
}

.cell.good {
  background: rgba(52, 211, 153, 0.15);
  border-color: #34d399;
  color: #a7f3d0;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
  max-width: 100%;
}

.controls button {
  background: #0d1c22;
  color: #f1f5f9;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.controls button:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #061316;
  box-shadow: 0 0 16px rgba(83, 142, 151, 0.35);
}

.status {
  padding: 12px 14px;
  background: #060b11;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent-300);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.small {
  color: var(--text-muted);
  font-size: 13px;
}

pre {
  background: #05090f;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #c8d8e4;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
}

footer.dsa-footer {
  text-align: center;
  color: var(--text-muted);
  padding: 35px 20px;
  border-top: 1px solid var(--card-border);
  font-size: 13px;
  position: relative;
  z-index: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Mobile Drawer Backdrop */
.sidebar-backdrop {
  display: none;
}

/* Mobile Floating Action Button */
.mobile-fab-toggle {
  display: none;
}

@media (max-width: 900px) {
  header.dsa-header {
    padding: 14px 16px;
  }

  .header-top {
    margin-bottom: 6px;
  }

  header.dsa-header h1 {
    font-size: 20px;
  }

  header.dsa-header p {
    font-size: 13px;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 14, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .layout {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: auto;
    position: static;
    z-index: auto;
    padding-top: 0;
  }

  aside {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 86vw !important;
    max-width: 360px !important;
    min-width: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 16px 16px 0 !important;
    background: #081418 !important;
    border-right: 1px solid var(--card-border) !important;
    border-top: none !important;
    border-left: none !important;
    border-bottom: none !important;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.85);
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px 16px 60px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #23454b #081418;
  }

  aside::-webkit-scrollbar {
    width: 6px;
  }

  aside::-webkit-scrollbar-track {
    background: #081418;
  }

  aside::-webkit-scrollbar-thumb {
    background: #23454b;
    border-radius: 6px;
  }

  aside.open {
    transform: translateX(0) !important;
  }

  body.sidebar-collapsed aside {
    width: 86vw !important;
    max-width: 360px !important;
    min-width: 0 !important;
    padding: 20px 16px 60px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    border-right: 1px solid var(--card-border) !important;
    overflow-y: auto !important;
    transform: translateX(-105%) !important;
  }

  body.sidebar-collapsed aside.open {
    transform: translateX(0) !important;
  }

  main.dsa-main {
    padding: 18px 14px 75px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .dsa-main .card {
    padding: 18px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
  }

  .problem-title {
    font-size: 19px;
  }

  .mobile-fab-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 22px;
    right: 18px;
    z-index: 80;
    background: #0d2229;
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: 999px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(83, 142, 151, 0.35);
    transition: all 0.2s ease;
  }

  .mobile-fab-toggle:hover,
  .mobile-fab-toggle:active {
    background: var(--primary);
    color: #061316;
    transform: scale(1.03);
  }
}

@media (max-width: 480px) {
  header.dsa-header {
    padding: 12px 12px;
  }

  .brand-sub {
    display: none;
  }

  main.dsa-main {
    padding: 14px 10px 70px;
  }

  .dsa-main .card {
    padding: 16px 12px;
  }

  .problem-title {
    font-size: 18px;
  }
}

/* =========================================================
   Reveal Code & Minimal-Line Python Solution Styles
   ========================================================= */

.reveal-code-card {
  position: relative;
  border-color: rgba(83, 142, 151, 0.35);
  background: linear-gradient(180deg, rgba(8, 22, 27, 0.96) 0%, rgba(6, 17, 20, 0.98) 100%);
}

.code-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.code-meta-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-lines {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 600;
}

.badge-time {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.badge-space {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

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

.btn-reveal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(83, 142, 151, 0.18);
  color: #e2e8f0;
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-reveal:hover {
  background: var(--primary);
  color: #061316;
  box-shadow: 0 0 14px rgba(83, 142, 151, 0.4);
}

.btn-reveal.active {
  background: rgba(83, 142, 151, 0.28);
  color: #fff;
  border-color: #38bdf8;
}

.code-container {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin-top 0.25s ease;
}

.code-container.revealed {
  max-height: 2500px;
  opacity: 1;
  margin-top: 14px;
}

.code-block {
  margin: 0;
  padding: 16px 18px;
  background: #040c0f;
  border: 1px solid rgba(83, 142, 151, 0.25);
  border-radius: 10px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.code-line {
  display: flex;
  align-items: baseline;
  min-height: 21px;
}

.code-line:hover {
  background: rgba(83, 142, 151, 0.08);
  border-radius: 4px;
}

.line-num {
  user-select: none;
  min-width: 32px;
  padding-right: 16px;
  color: #475569;
  text-align: right;
  font-size: 11.5px;
}

.line-code {
  flex: 1;
  white-space: pre;
  color: #cbd5e1;
}

/* Syntax Highlighting Tokens */
.tok-kw { color: #f472b6; font-weight: 600; }
.tok-type { color: #38bdf8; }
.tok-fn { color: #34d399; font-weight: 500; }
.tok-num { color: #fbbf24; }
.tok-comment { color: #64748b; font-style: italic; }

/* =========================================================
   Why Better Than Brute Force & Edge Cases Cards
   ========================================================= */

.brute-force-card {
  border-left: 4px solid #38bdf8;
  background: linear-gradient(180deg, rgba(7, 20, 26, 0.94) 0%, rgba(6, 17, 21, 0.97) 100%);
}

.complexity-compare {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 11.5px;
}

.brute-force-explanation {
  color: #cbd5e1;
  font-size: 14.5px;
  line-height: 1.7;
  margin: 0;
}

.edge-cases-card {
  border-left: 4px solid #fbbf24;
}

.edge-cases-list {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.75;
}

.edge-cases-list li {
  margin-bottom: 8px;
}

.edge-cases-list li:last-child {
  margin-bottom: 0;
}

/* =========================================================
   Problem-Specific Interactive Simulation Enhancements
   ========================================================= */

.sim-input-box {
  background: #040d11;
  border: 1px solid rgba(83, 142, 151, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sim-input-label {
  color: var(--accent-300);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sim-input-code {
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}

.sim-vars-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.sim-var-card {
  background: #091a20;
  border: 1px solid rgba(83, 142, 151, 0.28);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sim-var-name {
  color: var(--accent-300);
  font-weight: 600;
}

.sim-var-val {
  color: #f1f5f9;
}

.sim-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.sim-step-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
}

.btn-sim {
  background: #0d2026;
  color: #e2e8f0;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-sim:hover:not(:disabled) {
  border-color: var(--primary);
  color: #fff;
  background: rgba(83, 142, 151, 0.22);
}

.btn-sim-primary {
  background: rgba(83, 142, 151, 0.25);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.btn-sim-primary:hover:not(:disabled) {
  background: var(--primary);
  color: #061316;
}

.btn-sim:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}