/* ═══════════════════════════════════════════════════════
   Nakens — Multilingual CSS
   Adds: language switcher, layout fixes for longer text,
   Nika multilingual UI polish
═══════════════════════════════════════════════════════ */

/* ─── Language Switcher ─────────────────────────────── */

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.lang-switcher--footer {
  justify-content: center;
  margin-top: 12px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
  line-height: 1;
}

.lang-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn--active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn--active:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ─── Header placement ──────────────────────────────── */

/* Slot in header nav — place #lang-switcher-header before or after nav links */
#lang-switcher-header {
  display: flex;
  align-items: center;
  margin-left: 16px;
}

#lang-switcher-footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  opacity: 0.7;
}

/* ─── Long-text Layout Fixes ────────────────────────── */

/* Hero headline: Kazakh/Russian can be longer */
.hero-headline {
  word-break: break-word;
  hyphens: auto;
  /* Allow wrapping without breaking the layout */
  max-width: 18ch; /* tighten for better line breaks in KZ/RU */
}

/* Service card titles: prevent overflow on KZ/RU */
.service-card h3 {
  word-break: break-word;
  hyphens: auto;
  line-height: 1.3;
}

/* Service card descriptions */
.service-card p {
  word-break: break-word;
  hyphens: auto;
}

/* Step cards */
.step-card h3,
.step-card p {
  word-break: break-word;
  hyphens: auto;
}

/* Nav links: allow slight wrapping on smaller screens for long labels */
nav a {
  white-space: nowrap;
}

@media (max-width: 480px) {
  nav a {
    font-size: 13px;
  }
  #lang-switcher-header {
    margin-left: 8px;
  }
  .lang-btn {
    padding: 4px 7px;
    font-size: 10px;
  }
}

/* CTA buttons: ensure they don't break mid-word */
.cta-button,
.btn-primary,
.btn-secondary {
  white-space: nowrap;
}

@media (max-width: 360px) {
  .cta-button,
  .btn-primary,
  .btn-secondary {
    white-space: normal;
    text-align: center;
  }
}

/* ─── Nika Widget — Multilingual Polish ─────────────── */

/* Title can be longer in KZ/RU */
#nika-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Quick prompt buttons: allow wrapping */
.nika-quick-btn {
  white-space: normal;
  text-align: left;
  line-height: 1.3;
  min-height: 34px;
}

/* Message bubbles: support long words in KZ */
.nika-bubble {
  word-break: break-word;
  hyphens: auto;
  overflow-wrap: anywhere;
}

/* Typing indicator */
.nika-bubble--typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.nika-bubble--typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  animation: nika-bounce 1.2s infinite;
}

.nika-bubble--typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.nika-bubble--typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes nika-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Limit message area */
#nika-limit {
  display: none;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.nika-limit-msg {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  line-height: 1.5;
  word-break: break-word;
}

.nika-limit-cta {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

/* ─── hreflang / SEO Meta Helpers ────────────────────── */
/* No visual CSS needed — handled in HTML <head> */

/* ─── Transition for language switches ───────────────── */

[data-i18n],
[data-i18n-placeholder] {
  transition: opacity 0.15s ease;
}

body.lang-switching [data-i18n],
body.lang-switching [data-i18n-placeholder] {
  opacity: 0.4;
}
