/* ============================================================
   K INK — UI Fix & Enhancement v2.1
   Fixes all layout bugs + visual polish
   ============================================================ */

/* ══ 1. HERO BADGE FIX ══════════════════════════════════════ */
/* Ensure the badge never wraps words onto separate lines */
.hero-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* The blinking dot — only first empty span */
.hero-badge span:first-child {
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
  background: var(--gold) !important;
  border-radius: 50% !important;
  animation: blink 1.5s ease infinite !important;
  flex-shrink: 0 !important;
}

/* The text span — should just flow normally */
.hero-badge span[data-i18n],
.hero-badge span:last-child {
  display: inline !important;
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  background: transparent !important;
  border-radius: 0 !important;
  animation: none !important;
  white-space: nowrap !important;
  font-size: inherit !important;
  color: inherit !important;
}

/* ══ 2. CHATBOT WIDGET — Clean & Elegant ═══════════════════ */
.chatbot-widget {
  position: fixed !important;
  bottom: 28px !important;
  right: 28px !important;
  z-index: 1500 !important;
}

.chatbot-toggle {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background: #1A1208 !important;
  border: 2px solid rgba(212,175,55,0.6) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.2rem !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(212,175,55,0.2) !important;
  transition: all 0.25s ease !important;
  position: relative !important;
}

.chatbot-toggle:hover {
  border-color: var(--gold) !important;
  box-shadow: 0 6px 24px rgba(212,175,55,0.35), inset 0 1px 0 rgba(212,175,55,0.3) !important;
  transform: translateY(-2px) !important;
}

/* Chat badge */
.chat-badge {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  width: 18px !important;
  height: 18px !important;
  background: #E53E3E !important;
  border-radius: 50% !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #0A0A0A !important;
  font-family: 'Montserrat', sans-serif !important;
}

/* ══ 3. CHATBOT PANEL ════════════════════════════════════════ */
.chatbot-panel {
  position: absolute !important;
  bottom: 68px !important;
  right: 0 !important;
  width: 340px !important;
  max-height: 480px !important;
  background: #111111 !important;
  border: 1px solid rgba(212,175,55,0.2) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7) !important;
  opacity: 0 !important;
  transform: translateY(12px) scale(0.97) !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

.chatbot-panel.open {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: all !important;
}

.chatbot-header {
  background: linear-gradient(135deg, #1A1208, #2A1F0E) !important;
  border-bottom: 1px solid rgba(212,175,55,0.15) !important;
  padding: 14px 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.chatbot-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #D4AF37, #B8860B) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  color: #0A0A0A !important;
  flex-shrink: 0 !important;
}

.chatbot-info { flex: 1 !important; }
.chatbot-name {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  font-family: 'Montserrat', sans-serif !important;
}
.chatbot-status {
  font-size: 0.72rem !important;
  color: #48BB78 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.chatbot-status::before {
  content: '' !important;
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  background: #48BB78 !important;
  border-radius: 50% !important;
}

.chatbot-close {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.06) !important;
  border: none !important;
  color: rgba(255,255,255,0.6) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.8rem !important;
  transition: all 0.2s !important;
}
.chatbot-close:hover { background: rgba(255,255,255,0.12) !important; color: #fff !important; }

.chatbot-messages {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  scroll-behavior: smooth !important;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.2); border-radius: 2px; }

/* Chat messages */
.chat-msg {
  max-width: 85% !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  font-size: 0.82rem !important;
  line-height: 1.55 !important;
  font-family: 'Montserrat', sans-serif !important;
  animation: msgIn 0.25s ease !important;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.88) !important;
  align-self: flex-start !important;
  border-bottom-left-radius: 3px !important;
}

.chat-msg.user {
  background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(184,134,11,0.15)) !important;
  border: 1px solid rgba(212,175,55,0.25) !important;
  color: rgba(255,255,255,0.9) !important;
  align-self: flex-end !important;
  border-bottom-right-radius: 3px !important;
}

/* Typing indicator */
.chat-typing {
  display: flex !important;
  gap: 5px !important;
  align-items: center !important;
  padding: 10px 14px !important;
  background: rgba(255,255,255,0.04) !important;
  border-radius: 12px !important;
  border-bottom-left-radius: 3px !important;
  width: fit-content !important;
  align-self: flex-start !important;
}
.chat-typing span {
  width: 6px !important;
  height: 6px !important;
  background: rgba(212,175,55,0.6) !important;
  border-radius: 50% !important;
  animation: typingBounce 1s infinite !important;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s !important; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s !important; }
@keyframes typingBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* Quick replies */
.quick-replies {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 0 0 4px !important;
}
.quick-reply-btn {
  padding: 6px 12px !important;
  background: rgba(212,175,55,0.08) !important;
  border: 1px solid rgba(212,175,55,0.25) !important;
  border-radius: 20px !important;
  color: rgba(212,175,55,0.9) !important;
  font-size: 0.75rem !important;
  font-family: 'Montserrat', sans-serif !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
}
.quick-reply-btn:hover {
  background: rgba(212,175,55,0.15) !important;
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}

/* Chat input */
.chatbot-input {
  padding: 12px !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  display: flex !important;
  gap: 8px !important;
  background: #0D0D0D !important;
}
.chatbot-input input {
  flex: 1 !important;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 20px !important;
  padding: 9px 14px !important;
  color: rgba(255,255,255,0.9) !important;
  font-size: 0.82rem !important;
  font-family: 'Montserrat', sans-serif !important;
  outline: none !important;
  transition: border-color 0.2s !important;
}
.chatbot-input input:focus {
  border-color: rgba(212,175,55,0.4) !important;
}
.chatbot-input input::placeholder { color: rgba(255,255,255,0.3) !important; }

.chatbot-send {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #D4AF37, #B8860B) !important;
  border: none !important;
  color: #0A0A0A !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 0.8rem !important;
  flex-shrink: 0 !important;
  transition: all 0.2s !important;
}
.chatbot-send:hover { transform: scale(1.1) !important; }

/* ══ 4. NAVBAR — Fix overflow & gaps ════════════════════════ */
.nav-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.nav-links {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
}

.nav-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 70px !important;
}

/* ══ 5. FLOATING CONTACT BUTTONS (Zalo + Hotline) ══════════ */
.float-cta {
  position: fixed !important;
  bottom: 96px !important;
  right: 30px !important;
  z-index: 1400 !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: 12px !important;
  align-items: center !important;
}

.float-btn {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important;
  position: relative !important;
}

.float-btn:hover { transform: scale(1.12) translateY(-2px) !important; }

.float-btn-phone {
  background: linear-gradient(135deg, #25D366, #128C7E) !important;
  color: #fff !important;
  animation: pulse-float 2.5s infinite !important;
}

.float-btn-zalo {
  background: #0068FF !important;
  color: #fff !important;
}

@keyframes pulse-float {
  0%   { box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important; }
  50%  { box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 8px rgba(37,211,102,0.15) !important; }
  100% { box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important; }
}

/* Tooltip label */
.float-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(18,18,18,0.95);
  color: rgba(255,255,255,0.9);
  font-size: 0.72rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid rgba(255,255,255,0.08);
}

.float-btn:hover::before { opacity: 1; }

/* Back to top button fix */
#backToTop {
  position: fixed !important;
  bottom: 28px !important;
  left: 28px !important;
  right: auto !important;
  z-index: 1400 !important;
}

/* ══ 6. PWA BANNER FIX ══════════════════════════════════════ */
.pwa-banner {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #1A1208;
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 1600;
  transition: bottom 0.4s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 400px;
  width: calc(100% - 48px);
}
.pwa-banner.show { bottom: 20px; }
.pwa-icon { font-size: 1.6rem; flex-shrink: 0; }
.pwa-text { flex: 1; }
.pwa-text strong { display: block; font-size: 0.85rem; color: #fff; font-family: 'Montserrat',sans-serif; }
.pwa-text small { font-size: 0.72rem; color: rgba(255,255,255,0.5); font-family: 'Montserrat',sans-serif; }
.pwa-btns { display: flex; gap: 8px; align-items: center; }
.pwa-install-btn {
  padding: 8px 14px;
  background: linear-gradient(135deg,#D4AF37,#B8860B);
  border: none;
  border-radius: 20px;
  color: #0A0A0A;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Montserrat',sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.pwa-dismiss-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none; color: rgba(255,255,255,0.6);
  cursor: pointer; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}

/* ══ 7. SECTION VISUAL POLISH ══════════════════════════════ */
/* Tracker section */
.tracker-wrap h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }

/* Before-after slider */
.ba-item { border: 1px solid rgba(212,175,55,0.12); }

/* Quiz section */
.quiz-card { box-shadow: 0 4px 32px rgba(0,0,0,0.4); }

/* ══ 8. MOBILE FIXES ════════════════════════════════════════ */
@media (max-width: 768px) {
  .float-contact-group {
    right: 80px;
    bottom: 24px;
  }
  .float-btn { width: 44px; height: 44px; font-size: 1rem; }
  .chatbot-widget { bottom: 24px; right: 24px; }
  .chatbot-panel { width: calc(100vw - 32px); right: -16px; }
  .hero-badge { font-size: 0.68rem; letter-spacing: 1px; }
  .ba-grid { grid-template-columns: 1fr; }
  .quiz-options { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .nav-cta { display: none; }
  .dark-mode-toggle { display: none; }
}
