/* ============================================================
   ScenarioQ — Scenario Study Page (Nature-Inspired Theme)
   Warm ivory · Forest green #176B43 · Pale green #E8F3E9
   ============================================================ */

.scenario-page-main {
  padding-top: 1.25rem !important;
  padding-bottom: 3.5rem !important;
  max-width: 1280px;
  margin: 0 auto;
}

/* ─── Scenario Information Header Card ─── */
.scenario-header-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid rgba(48, 166, 112, 0.22);
  border-radius: 22px;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(20, 55, 36, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.scenario-header-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #143724 0%, #176B43 45%, #2c7a7b 100%);
}

.scenario-header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.scenario-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--nature-muted);
  flex-wrap: wrap;
}

.scenario-breadcrumb a {
  color: #176B43;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.scenario-breadcrumb a:hover {
  color: #143724;
  text-decoration: underline;
}

.scenario-breadcrumb .sep {
  opacity: 0.45;
}

.scenario-breadcrumb .current {
  color: #143724;
  font-weight: 700;
}

.scenario-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scenario-bookmark-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(48, 166, 112, 0.28);
  background: #ffffff;
  color: var(--nature-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 2px 6px rgba(20, 55, 36, 0.04);
}

.scenario-bookmark-btn:hover {
  background: #eaf6ee;
  color: #176B43;
  border-color: #176B43;
  transform: scale(1.08);
}

.scenario-bookmark-btn.bookmarked {
  background: #eaf6ee;
  border-color: #176B43;
  color: #176B43;
  box-shadow: 0 0 0 3px rgba(23, 107, 67, 0.18);
}

.scenario-bookmark-btn.bookmarked i {
  color: #176B43 !important;
}

/* Completion Button */
.btn-complete-scenario {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid #176B43;
  background: #ffffff;
  color: #176B43;
  box-shadow: 0 2px 8px rgba(20, 55, 36, 0.05);
}

.btn-complete-scenario:hover {
  background: #eaf6ee;
  transform: translateY(-1px);
}

.btn-complete-scenario.completed {
  background: #176B43;
  color: #ffffff;
  border-color: #176B43;
  box-shadow: 0 4px 14px rgba(23, 107, 67, 0.22);
}

.btn-complete-scenario.completed:hover {
  background: #125434;
}

.scenario-guest-auth-pill {
  font-size: 0.8rem;
  color: var(--nature-muted);
  background: #faf8f4;
  border: 1px dashed rgba(48, 166, 112, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.scenario-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.scenario-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 1.95rem);
  font-weight: 850;
  color: #143724;
  line-height: 1.25;
  letter-spacing: -0.02em;
  flex: 1 1 65%;
}

.scenario-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.scenario-tag {
  display: inline-flex;
  align-items: center;
  background: #eaf6ee;
  border: 1px solid rgba(48, 166, 112, 0.25);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: #176B43;
}

/* Scenario Header Progress Bar */
.scenario-header-progress {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(48, 166, 112, 0.14);
}

.scenario-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--nature-muted);
}

.scenario-progress-label strong {
  color: #143724;
  font-weight: 800;
}

.scenario-progress-bar {
  height: 8px;
  background: #eaf6ee;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.scenario-progress-bar .progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #176B43 0%, #2a734a 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ─── Main Two-Column Layout ─── */
.scenario-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  transition: grid-template-columns 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scenario-layout.sidebar-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
}

/* ─── Left Sidebar — Scenario Explorer ─── */
.scenario-explorer-sidebar {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(48, 166, 112, 0.22);
  border-radius: 20px;
  padding: 1.15rem;
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  box-shadow: 0 10px 28px rgba(20, 55, 36, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.explorer-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(48, 166, 112, 0.14);
}

.explorer-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #143724;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.explorer-title i {
  color: #176B43;
}

.explorer-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(48, 166, 112, 0.22);
  background: #ffffff;
  color: var(--nature-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.explorer-collapse-btn:hover {
  background: #eaf6ee;
  color: #176B43;
}

/* Collapsed rail representation */
.scenario-explorer-sidebar.collapsed {
  padding: 0.85rem 0.45rem;
  text-align: center;
  overflow: hidden;
}

.scenario-explorer-sidebar.collapsed .explorer-title,
.scenario-explorer-sidebar.collapsed .scenario-filter-bar,
.scenario-explorer-sidebar.collapsed .scenario-nav-list {
  display: none !important;
}

.scenario-explorer-sidebar.collapsed .explorer-collapsed-expand-btn {
  display: flex !important;
}

.explorer-collapsed-expand-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: none;
  background: transparent;
  color: #176B43;
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: 750;
  font-size: 0.75rem;
}

.explorer-collapsed-expand-btn i {
  font-size: 1.15rem;
}

.explorer-collapsed-expand-btn span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Filter Bar (All / Unsolved / Solved) */
.scenario-filter-bar {
  display: flex;
  gap: 0.35rem;
  background: #faf8f4;
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid rgba(48, 166, 112, 0.2);
  margin-bottom: 0.95rem;
}

.filter-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--nature-muted);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  color: #143724;
  background: rgba(48, 166, 112, 0.1);
}

.filter-btn.active {
  background: #176B43 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(23, 107, 67, 0.25);
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.filter-count {
  font-size: 0.72rem;
  background: rgba(48, 166, 112, 0.14);
  color: #176B43;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: 700;
}

/* Scenario Navigation List */
.scenario-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.scenario-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: #ffffff;
  border: 1.5px solid rgba(48, 166, 112, 0.18);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.scenario-nav-item:hover {
  background: #f4faf6;
  border-color: #176B43;
  transform: translateX(2px);
}

.scenario-nav-item.active {
  background: #eaf6ee !important;
  border-color: #176B43 !important;
  border-width: 2px !important;
  box-shadow: 0 2px 8px rgba(23, 107, 67, 0.1);
}

.scenario-nav-item.active .nav-label {
  color: #143724;
  font-weight: 800;
}

.scenario-nav-status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(48, 166, 112, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.scenario-nav-item.done .scenario-nav-status {
  background: #176B43;
  border-color: #176B43;
  color: #ffffff;
}

.nav-label {
  flex: 1 1 auto;
  font-size: 0.86rem;
  color: #233e2d;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Mobile Explorer Trigger & Drawer Backdrop ─── */
.mobile-explorer-trigger-bar {
  display: none;
  margin-bottom: 0.75rem;
}

.btn-mobile-explorer {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.25rem;
  background: #ffffff;
  border: 1.5px solid rgba(48, 166, 112, 0.28);
  border-radius: 12px;
  color: #143724;
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 55, 36, 0.05);
}

.btn-mobile-explorer i {
  color: #176B43;
}

.explorer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(19, 36, 25, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
}

.explorer-backdrop.active {
  display: block;
}

/* ─── Main Scenario Content Card ─── */
.scenario-content-card {
  background: #ffffff;
  border: 1.5px solid rgba(48, 166, 112, 0.22);
  border-radius: 24px;
  padding: clamp(1.5rem, 3.2vw, 2.4rem);
  box-shadow: 0 14px 38px rgba(20, 55, 36, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  overflow: hidden;
}

.scenario-section-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scenario-section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.scenario-section-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eaf6ee;
  border: 1px solid rgba(48, 166, 112, 0.25);
  color: #176B43;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.scenario-section-icon-box.amber {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.28);
  color: #b45309;
}

.scenario-section-icon-box.teal {
  background: #e6f6f6;
  border-color: rgba(44, 122, 123, 0.28);
  color: #2c7a7b;
}

.scenario-section-title {
  font-size: 1.15rem;
  font-weight: 850;
  color: #143724;
  margin: 0;
  letter-spacing: -0.015em;
}

.business-context-text {
  color: #1d3828;
  line-height: 1.75;
  margin: 0;
  font-size: 1rem;
}

/* Requirements List */
.requirements-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.requirements-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  line-height: 1.65;
  color: #1d3828;
  font-size: 0.98rem;
}

.req-marker {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: #eaf6ee;
  border: 1px solid rgba(48, 166, 112, 0.3);
  color: #176B43;
  font-weight: 800;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Constraints List */
.constraints-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.constraints-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  line-height: 1.65;
  color: #1d3828;
  font-size: 0.98rem;
}

.con-marker {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  background: #fef3c7;
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: #b45309;
  font-weight: 800;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Existing Behavior Box */
.existing-behavior-box {
  background: #faf8f4;
  border-left: 4px solid #176B43;
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
  color: #233e2d;
  line-height: 1.65;
  font-size: 0.96rem;
}

/* Code / Pattern Reference Block */
.scenario-code-card {
  background: #0d1b13;
  border: 1px solid rgba(48, 166, 112, 0.28);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.scenario-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(48, 166, 112, 0.15);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a7f3d0;
}

.scenario-code-block {
  margin: 0;
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', Consolas, Monaco, monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #d1fae5;
  white-space: pre;
}

/* Explanation & Best Practice Section */
.scenario-explanation-panel {
  background: #eaf6ee;
  border: 1.5px solid #176B43;
  border-radius: 18px;
  padding: 1.5rem 1.65rem;
  box-shadow: 0 4px 16px rgba(20, 55, 36, 0.05);
}

.explanation-header-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.explanation-icon {
  font-size: 1.35rem;
  color: #d97706;
}

.explanation-title {
  font-size: 1.2rem;
  font-weight: 850;
  color: #143724;
  margin: 0;
}

.explanation-body {
  color: #1a3826;
  line-height: 1.75;
  font-size: 0.98rem;
}

.explanation-body strong {
  color: #143724;
}

/* ─── Previous & Next Navigation Footer ─── */
.scenario-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid rgba(48, 166, 112, 0.18);
  margin-top: 0.5rem;
}

.btn-scenario-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
  min-height: 46px;
  user-select: none;
}

/* Previous (Outlined Forest Green) */
.btn-scenario-prev {
  background: #ffffff;
  border: 1.5px solid #176B43;
  color: #176B43;
  box-shadow: 0 2px 6px rgba(20, 55, 36, 0.04);
}

.btn-scenario-prev:hover:not(:disabled) {
  background: #eaf6ee;
  color: #143724;
  border-color: #143724;
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(23, 107, 67, 0.12);
}

.btn-scenario-prev:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(48, 166, 112, 0.25);
  color: var(--nature-muted);
  box-shadow: none;
  transform: none;
}

/* Next (Filled Forest Green) */
.btn-scenario-next {
  background: #176B43;
  border: 1.5px solid #176B43;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(23, 107, 67, 0.25);
}

.btn-scenario-next:hover:not(:disabled) {
  background: #125434;
  border-color: #125434;
  transform: translateX(2px);
  box-shadow: 0 6px 18px rgba(23, 107, 67, 0.32);
}

.btn-scenario-next:disabled {
  opacity: 0.45;
  background: #8aa595;
  border-color: #8aa595;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Empty filter state card */
.filter-empty-card {
  background: #ffffff;
  border: 1.5px solid rgba(48, 166, 112, 0.22);
  border-radius: 22px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(20, 55, 36, 0.05);
}

.filter-empty-card h3 {
  font-size: 1.65rem;
  font-weight: 850;
  color: #143724;
  margin: 0 0 0.5rem 0;
}

.filter-empty-card p {
  color: var(--nature-muted);
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
}

/* ─── Responsive Adjustments ─── */
@media (max-width: 900px) {
  .scenario-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .mobile-explorer-trigger-bar {
    display: block;
  }

  .scenario-explorer-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 310px;
    max-width: 85vw;
    z-index: 999;
    border-radius: 0 22px 22px 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    transform: translateX(-100%);
    max-height: 100vh;
  }

  .scenario-explorer-sidebar.mobile-open {
    transform: translateX(0);
  }

  .explorer-collapse-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .scenario-header-card {
    padding: 1.15rem 1.15rem;
    border-radius: 18px;
  }

  .scenario-title {
    font-size: 1.25rem;
  }

  .scenario-content-card {
    padding: 1.35rem 1.15rem;
    border-radius: 18px;
    gap: 1.35rem;
  }

  .scenario-nav-footer {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .btn-scenario-nav {
    flex: 1 1 calc(50% - 0.4rem);
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    justify-content: center;
  }
}
