/* Language switcher styles (scoped with ls- prefix) */

.ls-fab,
.ls-fab * {
  box-sizing: border-box;
}

/* Region filter pills bar */
.ls-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ls-filter {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 5px 13px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ls-filter:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
}

/* Active filter: stay dark even on hover */
.ls-filter--active,
.ls-filter--active:hover {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

/* Search wrapper + field */
.ls-search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 18px;
}

#ls-search {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border-radius: 999px;
  border: 2px solid #e5e7eb;
  font-size: 14px;
  outline: none;
  background: #ffffff;
}

#ls-search:focus {
  border-color: #2563eb;
}

/* Clear "X" inside search */
#ls-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 14px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

#ls-search-clear:hover {
  background: #d1d5db;
}

/* Grid of language cards: 3 per row on desktop */
#ls-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* Language card */
.ls-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 14px;
  color: #111827;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

.ls-item:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

.ls-item--active {
  border-color: #2563eb;
  background: #e0edff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* Left side: flag + name */
.ls-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ls-item-flag {
  font-size: 18px;
}

.ls-item-name {
  font-size: 14px;
}

/* Right side: language code */
.ls-item-code {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

/* Floating action button */
.ls-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ffffff;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  z-index: 9999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-dark);
}

.ls-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.3);
}

/* No results message */
.ls-no-results {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 8px 4px 0;
  grid-column: 1 / -1;
}

/* Focus styles for accessibility */
.ls-item:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.ls-filter:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.ls-fab:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Mobile: 2 columns */
@media (max-width: 768px) {
  #ls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ls-item {
    padding: 8px 10px;
  }

  .ls-fab {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    letter-spacing: 1px;
    bottom: 15px;
    right: 15px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .ls-item,
  .ls-filter,
  .ls-fab {
    transition: none;
  }
}
