/* ==========================================================================
   DELEGATE ERP — Core MODULES Interactive Showcase
   Clean, light, balanced split layout with all 10 real Delegate ERP Departments
   ========================================================================== */

.modules-section {
  position: relative;
  padding: 76px 0 88px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf7 100%);
  border-top: 1px solid #e7efe9;
}

.modules-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 36px);
}

/* ==========================================================================
   Centered Section Header
   ========================================================================== */
.modules-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 28px;
}

.modules-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(2rem, 3.1vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: #182518;
  line-height: 1.15;
  margin-bottom: 10px;
}

.modules-title span {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  color: #15803d;
}

.modules-subtitle {
  font-size: 0.96rem;
  line-height: 1.6;
  color: #536256;
}

/* ==========================================================================
   Top 10-Department Selector Bar
   ========================================================================== */
.modules-cat-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.modules-cat-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d8e5dc;
  box-shadow: 0 8px 24px -14px rgba(20, 42, 18, 0.14);
  max-width: 100%;
}

.modules-cat-btn {
  padding: 9px 14px;
  border-radius: 8px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  color: #324433;
  background: transparent;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}

.modules-cat-btn:hover {
  color: #15803d;
  background: #eef8f1;
}

.modules-cat-btn.is-active {
  background: #15803d;
  color: #ffffff;
  box-shadow: 0 6px 14px -5px rgba(21, 128, 61, 0.45);
}

/* ==========================================================================
   Balanced Split Showcase (Left Sub-Module List + Right Detail Card)
   ========================================================================== */
.modules-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

/* Left Column: Clean Light Numbered Sub-Module List */
.modules-rail {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 470px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 128, 61, 0.28) transparent;
}

.modules-rail::-webkit-scrollbar {
  width: 5px;
}

.modules-rail::-webkit-scrollbar-thumb {
  background: rgba(21, 128, 61, 0.25);
  border-radius: 6px;
}

.rail-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #ffffff;
  color: #243524;
  text-align: left;
  border: 1px solid #e1eae4;
  box-shadow: 0 4px 12px -8px rgba(18, 40, 16, 0.12);
  flex-shrink: 0;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.rail-btn:hover {
  border-color: #86efac;
  background: #f5fcf7;
  color: #15803d;
}

.rail-btn.is-active {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
  box-shadow: 0 12px 24px -10px rgba(21, 128, 61, 0.48);
}

.rail-btn-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.rail-num {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  color: #15803d;
  background: #eef8f1;
  padding: 3px 7px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  transition: background-color 180ms ease, color 180ms ease;
}

.rail-btn.is-active .rail-num {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.rail-name {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
}

.rail-arrow {
  width: 15px;
  height: 15px;
  opacity: 0.45;
  flex-shrink: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.rail-btn:hover .rail-arrow,
.rail-btn.is-active .rail-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* ==========================================================================
   Right Stage Card: Details + Crisp Laptop & Mobile Hardware Preview
   ========================================================================== */
.modules-stage {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: center;
  padding: 34px 36px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #dce6df;
  box-shadow: 0 18px 44px -22px rgba(18, 40, 16, 0.14);
}

.stage-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: stageIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stage-meta-num {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #15803d;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.stage-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.45rem, 2.15vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #182518;
  line-height: 1.2;
  margin-bottom: 10px;
}

.stage-title span {
  color: #16a34a;
}

.stage-desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #536256;
  margin-bottom: 18px;
}

.stage-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
}

.stage-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.89rem;
  font-weight: 500;
  color: #213021;
}

.stage-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stage-check svg {
  width: 11px;
  height: 11px;
}

.stage-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  background: #15803d;
  color: #ffffff;
  font-size: 0.89rem;
  font-weight: 600;
  transition: background-color 180ms ease, transform 180ms ease;
}

.stage-cta svg {
  width: 15px;
  height: 15px;
  transition: transform 180ms ease;
}

.stage-cta:hover {
  background: #23331f;
  transform: translateY(-1px);
}

.stage-cta:hover svg {
  transform: translateX(3px);
}

/* ==========================================================================
   Right Visual: Clean Real 3D Laptop & Mobile PNG Mockup (Zero Boxy Wrapper)
   ========================================================================== */
.stage-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  animation: stageIn 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mod-png-stage {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1586 / 992;
  cursor: zoom-in;
  user-select: none;
  transition: transform 280ms var(--ease-smooth);
}

.mod-png-stage:hover {
  transform: translateY(-3px);
}

.mod-png-frame {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 22px 32px rgba(18, 40, 16, 0.18));
}

.mod-screen-slot {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  overflow: hidden;
  background: #f4f7f8;
}

.mod-screen-slot--laptop {
  z-index: 2;
  width: 860px;
  height: 590px;
}

.mod-screen-slot--mobile {
  z-index: 3;
  width: 248px;
  height: 540px;
  border-radius: 26px;
}

.mod-screen-slot img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.mod-zoom-hint {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #5c6e5f;
  transition: color 180ms ease;
}

.mod-zoom-hint svg {
  width: 13px;
  height: 13px;
  color: #15803d;
}

.mod-zoom-hint:hover {
  color: #15803d;
}

/* ==========================================================================
   Back-to-Top Floating Button (Above WhatsApp Button)
   ========================================================================== */
.back-to-top-btn {
  position: fixed;
  right: 25px;
  bottom: 84px;
  z-index: 940;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid rgba(55, 76, 49, 0.2);
  color: var(--brand-forest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(20, 42, 18, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 240ms ease, visibility 240ms ease, transform 240ms ease, background-color 200ms ease, color 200ms ease;
}

.back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

.back-to-top-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1140px) {
  .modules-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
  }

  .modules-stage {
    grid-template-columns: 1fr;
    padding: 26px;
    gap: 22px;
  }
}

@media (max-width: 840px) {
  .modules-shell {
    grid-template-columns: 1fr;
  }

  .modules-rail {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    padding-right: 0;
  }
}

@media (max-width: 600px) {
  .modules-section {
    padding: 54px 0 64px;
  }

  .modules-cat-bar {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .modules-cat-bar::-webkit-scrollbar {
    display: none;
  }

  .modules-cat-btn {
    padding: 8px 13px;
    font-size: 0.8rem;
  }

  .modules-stage {
    padding: 20px 16px;
  }

  .stage-preview {
    padding: 4px 0;
  }
}
