/* =====================================================================
   KỸ NĂNG VIỆT — FLOATING CONTACT CLUSTER (Editorial UK/EU)
   Prefix: knv-fc-*  |  Tokens: assets/css/design-system.css
   Pattern: FAB expandable, gold-accent monochrome
   ===================================================================== */

.knv-fc {
  position: fixed;
  right: 28px;
  bottom: 70px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  font-family: var(--font-sans);
  pointer-events: none;
}
.knv-fc__fab {
  pointer-events: auto;
}

/* =====================================================================
   FAB (main button)
   ===================================================================== */
.knv-fc__fab {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: var(--navy);
  color: var(--secondary);
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}
.knv-fc__fab:hover {
  background-color: var(--primary-dark);
  box-shadow: var(--shadow-gold-hover);
  transform: translateY(-2px);
}
.knv-fc__fab:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}
.knv-fc__fab:active {
  transform: translateY(0);
}

/* Cross-fade two icons inside FAB */
.knv-fc__fab-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 22px;
  transition:
    opacity 0.25s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.knv-fc__fab-icon--open {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}
.knv-fc__fab-icon--close {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg) scale(0.6);
}
.knv-fc.is-open .knv-fc__fab-icon--open {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scale(0.6);
}
.knv-fc.is-open .knv-fc__fab-icon--close {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* =====================================================================
   MENU container
   ===================================================================== */
.knv-fc__menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.knv-fc.is-open .knv-fc__menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* =====================================================================
   Item rows (label + button)
   ===================================================================== */
.knv-fc__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  transition:
    opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.knv-fc.is-open .knv-fc__item {
  opacity: 1;
  transform: translateY(0) scale(1);
}
/* Stagger (top-down when expanded — DOM order is hotline first which becomes top) */
.knv-fc.is-open .knv-fc__item:nth-child(1) {
  transition-delay: 0ms;
}
.knv-fc.is-open .knv-fc__item:nth-child(2) {
  transition-delay: 60ms;
}
.knv-fc.is-open .knv-fc__item:nth-child(3) {
  transition-delay: 120ms;
}
.knv-fc.is-open .knv-fc__item:nth-child(4) {
  transition-delay: 180ms;
}
.knv-fc.is-open .knv-fc__socials {
  transition-delay: 220ms;
}

/* Close: zero delay so it collapses snappy */
.knv-fc:not(.is-open) .knv-fc__item,
.knv-fc:not(.is-open) .knv-fc__socials {
  transition-delay: 0ms;
}

/* Label pill */
.knv-fc__label {
  display: inline-block;
  padding: 9px 14px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  position: relative;
  line-height: 1.2;
  transition:
    color var(--transition-base),
    transform var(--transition-base),
    background-color var(--transition-base);
}
.knv-fc__label::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

/* Button (circular) */
.knv-fc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--surface);
  border: 1.5px solid var(--secondary);
  color: var(--secondary);
  font-size: 18px;
  box-shadow: var(--shadow-card);
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}
.knv-fc__btn iconify-icon {
  font-size: 18px;
}

/* Hover state for entire item */
.knv-fc__item:hover .knv-fc__btn,
.knv-fc__item:focus-visible .knv-fc__btn {
  background-color: var(--secondary);
  color: var(--white-color);
  border-color: var(--secondary-hover);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}
.knv-fc__item:hover .knv-fc__label,
.knv-fc__item:focus-visible .knv-fc__label {
  color: var(--navy);
  transform: translateX(-4px);
}
.knv-fc__item:focus-visible {
  outline: none;
}

/* =====================================================================
   Social mini row
   ===================================================================== */
.knv-fc__socials {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  transition:
    opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.knv-fc.is-open .knv-fc__socials {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.knv-fc__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-secondary);
  text-decoration: none;
  transition:
    color var(--transition-base),
    background-color var(--transition-base),
    transform var(--transition-fast);
}
.knv-fc__social iconify-icon {
  font-size: 15px;
}
.knv-fc__social:hover,
.knv-fc__social:focus-visible {
  color: var(--white-color);
  background-color: var(--secondary);
  transform: translateY(-2px);
}
.knv-fc__social:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* =====================================================================
   Reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .knv-fc__fab,
  .knv-fc__fab-icon,
  .knv-fc__menu,
  .knv-fc__item,
  .knv-fc__btn,
  .knv-fc__label,
  .knv-fc__socials,
  .knv-fc__social {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

/* =====================================================================
   RESPONSIVE (max-width only)
   ===================================================================== */

/* Tablet (≤991.98px) */
@media (max-width: 991.98px) {
  .knv-fc {
    right: 22px;
    bottom: 70px;
    gap: 12px;
  }
  .knv-fc__fab {
    width: 54px;
    height: 54px;
  }
  .knv-fc__fab-icon {
    font-size: 21px;
  }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
  .knv-fc {
    right: 16px;
    bottom: 70px;
    gap: 10px;
  }
  .knv-fc__fab {
    width: 52px;
    height: 52px;
  }
  .knv-fc__fab-icon {
    font-size: 20px;
  }
  .knv-fc__btn {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  .knv-fc__btn iconify-icon {
    font-size: 16px;
  }
  .knv-fc__label {
    font-size: 12.5px;
    padding: 8px 12px;
  }
  .knv-fc__menu {
    gap: 10px;
  }
  .knv-fc__socials {
    padding: 7px 10px;
    gap: 5px;
  }
  .knv-fc__social {
    width: 30px;
    height: 30px;
  }
  .knv-fc__social iconify-icon {
    font-size: 14px;
  }
}

/* Mobile small (≤576px) — hide label pills, keep buttons only */
@media (max-width: 576px) {
  .knv-fc__label {
    display: none;
  }
  .knv-fc__item {
    gap: 0;
  }
  .knv-fc__menu {
    gap: 8px;
  }
}

/* Very small (≤350px) */
@media (max-width: 350px) {
  .knv-fc {
    right: 12px;
    bottom: 70px;
    gap: 8px;
  }
  .knv-fc__fab {
    width: 48px;
    height: 48px;
  }
  .knv-fc__fab-icon {
    font-size: 18px;
  }
  .knv-fc__btn {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }
  .knv-fc__btn iconify-icon {
    font-size: 15px;
  }
  .knv-fc__social {
    width: 28px;
    height: 28px;
  }
}
