/* ============================================================
   FILE: assets/css/footer.css
   Responsive footer with auto-sizing fonts — Cleaned
   ============================================================ */

/* ---------- Footer ---------- */
.kx9-footer {
  margin-top: 44px;
  background: #f8fafc;
  color: #475569;
  transition: background .3s var(--kx9-ease), color .3s var(--kx9-ease);
}

[data-theme="dark"] .kx9-footer {
  background: #0b0e14;
  color: #8a93a6;
}

.kx9-footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* ---------- Footer Grid ---------- */
.kx9-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 4vw, 40px);
  padding: clamp(28px, 5vw, 48px) 0 clamp(20px, 3vw, 32px);
}

/* ---------- Footer Brand ---------- */
.kx9-footer-brand .kx9-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: #0f172a;
  margin-bottom: 12px;
  transition: color .3s var(--kx9-ease);
}

[data-theme="dark"] .kx9-footer-brand .kx9-brand {
  color: #e5e9f0;
}

.kx9-footer-brand .kx9-brand-mark {
  width: clamp(26px, 4vw, 32px);
  height: clamp(26px, 4vw, 32px);
  border-radius: var(--kx9-r);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(11px, 1.5vw, 14px);
  background: linear-gradient(135deg, var(--kx9-brand), var(--kx9-accent));
  box-shadow: 0 4px 10px rgba(37,99,235,.3);
}

.kx9-footer-brand .kx9-brand em {
  font-style: normal;
  background: linear-gradient(90deg, var(--kx9-brand), var(--kx9-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kx9-footer-brand p {
  margin: 10px 0 16px;
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  line-height: 1.6;
  max-width: 36ch;
  color: #64748b;
  transition: color .3s var(--kx9-ease);
}

[data-theme="dark"] .kx9-footer-brand p {
  color: #8a93a6;
}

/* ---------- Social Icons ---------- */
.kx9-social {
  display: flex;
  gap: clamp(6px, 1.2vw, 10px);
  flex-wrap: wrap;
}

.kx9-social a {
  width: clamp(32px, 5vw, 38px);
  height: clamp(32px, 5vw, 38px);
  display: grid;
  place-items: center;
  border-radius: var(--kx9-r);
  background: rgba(15,23,42,.06);
  color: #475569;
  text-decoration: none;
  font-size: clamp(13px, 2vw, 15px);
  transition: transform .25s var(--kx9-ease), background .25s, color .25s, box-shadow .25s;
}

[data-theme="dark"] .kx9-social a {
  background: rgba(255,255,255,.06);
  color: #c3cbd7;
}

.kx9-social a:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--kx9-brand), var(--kx9-accent));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37,99,235,.25);
}

/* ---------- Footer Columns ---------- */
.kx9-footer-col h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: clamp(12px, 2vw, 18px);
  transition: color .3s var(--kx9-ease);
}

[data-theme="dark"] .kx9-footer-col h4 {
  color: #e5e9f0;
}

.kx9-footer-col h4 i {
  color: var(--kx9-brand);
  font-size: clamp(14px, 2vw, 18px);
}

.kx9-footer-col a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  text-decoration: none;
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  padding: clamp(4px, 0.8vw, 6px) 0;
  transition: color .2s, transform .2s, gap .2s;
}

[data-theme="dark"] .kx9-footer-col a {
  color: #94a3b8;
}

.kx9-footer-col a::before {
  content: '›';
  font-size: clamp(12px, 1.8vw, 16px);
  font-weight: 700;
  color: var(--kx9-brand);
  transition: transform .2s;
}

.kx9-footer-col a:hover {
  color: var(--kx9-brand);
  transform: translateX(3px);
  gap: 10px;
}

.kx9-footer-col a:hover::before {
  transform: translateX(2px);
}

/* ---------- Footer Bottom ---------- */
.kx9-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: clamp(14px, 2vw, 20px) 0;
  border-top: 1px solid rgba(15,23,42,.08);
  font-size: clamp(0.7rem, 1.1vw, 0.82rem);
  color: #64748b;
  transition: border-color .3s var(--kx9-ease), color .3s var(--kx9-ease);
}

[data-theme="dark"] .kx9-footer-bottom {
  border-top-color: rgba(255,255,255,.06);
  color: #8a93a6;
}

.kx9-footer-bottom span:first-child {
  text-align: left;
}

.kx9-footer-bottom span:last-child {
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kx9-footer-bottom i {
  transition: transform .3s;
  color: #ef4444;
}

.kx9-footer-bottom:hover i {
  transform: scale(1.25);
}

/* ---------- Scroll to Top Button ---------- */
.kx9-scroll-top {
  position: fixed;
  right: clamp(14px, 3vw, 22px);
  bottom: clamp(14px, 3vw, 22px);
  width: clamp(38px, 6vw, 46px);
  height: clamp(38px, 6vw, 46px);
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  font-size: clamp(13px, 2vw, 16px);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(15,23,42,.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all .35s var(--kx9-ease);
  z-index: 950;
}

[data-theme="dark"] .kx9-scroll-top {
  border-color: #2d3748;
  background: #1b2330;
  color: #e5e9f0;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

.kx9-scroll-top.kx9-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.kx9-scroll-top:hover {
  background: linear-gradient(135deg, var(--kx9-brand), var(--kx9-accent));
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 28px rgba(37,99,235,.3);
}

[data-theme="dark"] .kx9-scroll-top:hover {
  box-shadow: 0 10px 28px rgba(99,102,241,.4);
}

.kx9-scroll-top:active {
  transform: translateY(-1px) scale(0.98);
}

/* ============================================================
   RESPONSIVE — Consolidated (no duplicates)
   ============================================================ */

/* Tablet: 2 columns */
@media (max-width: 1100px) {
  .kx9-footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(20px, 4vw, 32px);
  }
}

/* Small tablet: brand spans full width, centered */
@media (max-width: 768px) {
  .kx9-footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(18px, 4vw, 28px);
  }
  .kx9-footer-brand {
    grid-column: 1 / -1;
    text-align: center;
  }
  .kx9-footer-brand p {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .kx9-social {
    justify-content: center;
  }
  /* Footer bottom stays side-by-side on tablet */
}

/* Mobile: 2 columns, smaller text */
@media (max-width: 560px) {
  .kx9-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 4vw, 24px);
  }
  .kx9-footer-brand {
    grid-column: 1 / -1;
  }
  .kx9-footer-col h4 {
    font-size: clamp(0.8rem, 3.5vw, 0.95rem);
  }
  .kx9-footer-col a {
    font-size: clamp(0.7rem, 3vw, 0.82rem);
  }
  .kx9-footer-bottom {
    font-size: clamp(0.65rem, 2.8vw, 0.75rem);
  }
  /* Stack footer bottom on small mobile */
  .kx9-footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
  .kx9-footer-bottom span:first-child,
  .kx9-footer-bottom span:last-child {
    text-align: center;
    justify-content: center;
  }
  .kx9-scroll-top {
    width: clamp(36px, 8vw, 42px);
    height: clamp(36px, 8vw, 42px);
    right: 14px;
    bottom: 14px;
    font-size: 13px;
  }
}

/* Very small mobile: single column */
@media (max-width: 360px) {
  .kx9-footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .kx9-footer-col h4 {
    justify-content: center;
  }
  .kx9-footer-col a {
    justify-content: center;
  }
  .kx9-social {
    justify-content: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .kx9-scroll-top,
  .kx9-footer-col a::before,
  .kx9-social a,
  .kx9-footer-col a,
  .kx9-footer-bottom i {
    animation: none !important;
    transition: none !important;
  }
}