/* ==========================================================================
   DELEGATE ERP — Why Schools Choose DELEGATE (Clean Minimalist Showcase)
   Left-aligned header + clean text tabs with subtle dividers & active underline
   ========================================================================== */

.why-choose-section {
  position: relative;
  padding: 60px 0 72px;
  background: #f3f8f5;
  border-top: 1px solid #e4ede7;
}

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

/* ==========================================================================
   Clean Split Header (Left Title + Right Minimalist Text Tabs)
   ========================================================================== */
.why-choose-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6eee8;
}

.why-choose-header {
  max-width: 560px;
  text-align: left;
}

.why-choose-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #15803d;
  margin-bottom: 8px;
}

.why-choose-eyebrow::before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #15803d;
}

.why-choose-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.8rem, 2.75vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #142217;
  line-height: 1.15;
  margin-bottom: 6px;
}

.why-choose-title span {
  font-family: "Sora", sans-serif;
  color: #15803d;
}

.why-choose-sub {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #5a695c;
}

/* ==========================================================================
   Simple Clean Text Tabs with Subtle Divider Lines & Active Underline
   ========================================================================== */
.why-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  margin-bottom: -21px;
}

.why-filter-sep {
  width: 1px;
  height: 14px;
  background: #d5e0d8;
  flex-shrink: 0;
  margin-bottom: 18px;
}

.why-filter-btn {
  position: relative;
  padding: 6px 2px 18px;
  border: none;
  background: transparent;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #627366;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms ease;
}

.why-filter-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #15803d;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.why-filter-btn:hover {
  color: #142217;
}

.why-filter-btn:focus-visible {
  outline: 2px solid #15803d;
  outline-offset: 4px;
  border-radius: 4px;
}

.why-filter-btn.is-active {
  color: #15803d;
  font-weight: 700;
}

.why-filter-btn.is-active::after {
  transform: scaleX(1);
}

/* ==========================================================================
   Compact Refined 4x2 Mini Cards
   ========================================================================== */
.why-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.why-item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 16px 18px;
  border-radius: 13px;
  background: #ffffff;
  border: 1px solid #e2ece5;
  border-bottom: 3px solid #cfe6d7;
  box-shadow:
    0 12px 24px -14px rgba(15, 42, 22, 0.16),
    0 4px 8px -4px rgba(15, 42, 22, 0.08);
  transform: translateY(0);
  animation: whyCardFade 240ms ease calc(var(--i, 0) * 22ms) backwards;
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease;
}

@keyframes whyCardFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.why-item-card:hover {
  transform: translateY(3px);
  box-shadow:
    0 4px 10px -6px rgba(15, 42, 22, 0.14),
    0 1px 3px -1px rgba(15, 42, 22, 0.08);
}

.why-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.why-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f0faf3 0%, #e1f4e7 100%);
  border: 1px solid #d5ecd9;
  color: #15803d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.why-item-icon svg {
  width: 16px;
  height: 16px;
}

.why-item-card:hover .why-item-icon {
  background: #15803d;
  border-color: #15803d;
  color: #ffffff;
  box-shadow: 0 6px 12px -4px rgba(21, 128, 61, 0.45);
}

.why-item-tag {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #15803d;
  background: #f1faf4;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.why-item-card h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: #132116;
  line-height: 1.28;
}

.why-item-card p {
  font-size: 0.78rem;
  line-height: 1.48;
  color: #5c6d60;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  .why-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 980px) {
  .why-choose-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 0;
  }

  .why-filter-bar {
    width: 100%;
    margin-bottom: -1px;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 14px;
  }

  .why-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .why-filter-btn {
    padding: 6px 2px 14px;
  }

  .why-filter-sep {
    margin-bottom: 10px;
  }
}

@media (max-width: 640px) {
  .why-choose-section {
    padding: 46px 0 54px;
  }

  .why-cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .why-item-card {
    padding: 14px 15px;
  }
}
