/* =====================================================
   IT4B Interactive Enhancements — interactive.css
   ===================================================== */

/* ── Enhancement 1: Scroll Progress Bar ── */
#it4b-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #c8861a, #4caf82);
  z-index: 99999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

/* ── Enhancement 2: Scroll-to-Top Button ── */
#it4b-scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1a4a2e;
  color: #fff;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#it4b-scroll-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
#it4b-scroll-top:hover {
  background: #c8861a;
  transform: translateY(-3px) scale(1.08);
}
#it4b-scroll-top.visible:hover {
  opacity: 1;
}

/* ── Enhancement 3: Scroll Reveal ── */
.it4b-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.it4b-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Enhancement 4: Collapsible Card Lists ── */
.it4b-list-wrap .it4b-list-inner {
  max-height: 118px;
  overflow: hidden;
  transition: max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.it4b-list-wrap.expanded .it4b-list-inner {
  max-height: 1000px;
}
.it4b-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 4px 13px;
  background: rgba(27, 107, 58, 0.07);
  border: 1px solid rgba(27, 107, 58, 0.25);
  border-radius: 20px;
  color: #1B6B3A;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}
.it4b-expand-btn:hover {
  background: rgba(27, 107, 58, 0.14);
  border-color: rgba(27, 107, 58, 0.45);
}
.it4b-expand-btn .arr {
  display: inline-block;
  transition: transform 0.3s;
  font-size: 10px;
  line-height: 1;
}
.it4b-list-wrap.expanded .it4b-expand-btn .arr {
  transform: rotate(180deg);
}

/* ── Enhancement 5: Reference Filter Tabs ── */
.it4b-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 32px;
  justify-content: center;
}
.it4b-filter-tab {
  padding: 7px 17px;
  border-radius: 24px;
  border: 1.5px solid rgba(30, 74, 46, 0.4);
  background: transparent;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
  font-family: inherit;
  color: inherit;
}
.it4b-filter-tab:hover,
.it4b-filter-tab.active {
  background: #1a4a2e;
  color: #fff;
  border-color: #1a4a2e;
}
.it4b-ref-card.it4b-hidden {
  display: none !important;
}
.it4b-ref-card:not(.it4b-hidden) {
  animation: fadeUp 0.3s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Enhancement 6: Card Hover Lift ── */
.it4b-card-hover {
  position: relative;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.28s ease;
}
.it4b-card-hover:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  z-index: 2;
}
.it4b-card-hover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.05);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  border-radius: inherit;
}
.it4b-card-hover:hover::before {
  opacity: 1;
}

/* ── Enhancement 7: Stat Counters & Tooltips ── */
.it4b-stat-wrap {
  position: relative;
  display: inline-block;
}
.it4b-stat-tip {
  visibility: hidden;
  opacity: 0;
  background: #1a2a1e;
  color: #fff;
  font-size: 0.74rem;
  border-radius: 8px;
  padding: 6px 12px;
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: opacity 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  z-index: 200;
}
.it4b-stat-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a2a1e;
}
.it4b-stat-wrap:hover .it4b-stat-tip {
  visibility: visible;
  opacity: 1;
}

/* ── Enhancement 8: Active Nav Link ── */
.it4b-nav-active {
  color: #c8861a !important;
  font-weight: 700 !important;
}

/* ── Enhancement 9: Table Row Hover ── */
tr.it4b-tr-hover {
  transition: background 0.18s ease;
}
tr.it4b-tr-hover:hover {
  background: rgba(200, 134, 26, 0.09) !important;
}

/* ── Enhancement 10: Partner Logo Hover ── */
.it4b-partner-item {
  transition: transform 0.25s ease, filter 0.25s ease;
}
.it4b-partner-item:hover {
  transform: scale(1.1) translateY(-4px);
  filter: brightness(1.15);
}

/* ── Enhancement 11: Form Enhancements ── */
.it4b-field-focus {
  transition: box-shadow 0.22s, border-color 0.22s;
}
.it4b-field-focus:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(200, 134, 26, 0.32) !important;
  border-color: #c8861a !important;
}
.it4b-char-count {
  font-size: 0.74rem;
  text-align: right;
  margin-top: 4px;
  color: #888;
  transition: color 0.2s;
}

/* ── Enhancement 12: CTA Pulse ── */
@keyframes ctaPulse {
  0%,  100% { box-shadow: 0 0 0 0 rgba(200, 134, 26, 0.5); }
  50%        { box-shadow: 0 0 0 12px rgba(200, 134, 26, 0); }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  #it4b-progress-bar,
  #it4b-scroll-top,
  .it4b-reveal,
  .it4b-list-wrap .it4b-list-inner,
  .it4b-expand-btn .arr,
  .it4b-ref-card:not(.it4b-hidden),
  .it4b-card-hover,
  .it4b-card-hover::before,
  .it4b-stat-tip,
  tr.it4b-tr-hover,
  .it4b-partner-item,
  .it4b-field-focus {
    transition: none !important;
    animation: none !important;
  }
  .it4b-reveal {
    opacity: 1;
    transform: none;
  }
}
