/* 
 * CSS for Webdesk Language Switcher popup
 * Created by WEBDESK LLC team
 */

/* Overlay */
.wls-lang-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Modal */
.wls-lang-modal {
  background: #ffffff;
  border-radius: 24px;
  padding: 12px 20px 16px;
  width: min(640px, 94vw);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

/* Header (close button only) */
.wls-lang-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.wls-lang-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  border-radius: 999px;
}

.wls-lang-close:hover {
  background: #f4f5f6;
}

/* List */
.wls-lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(450px, 70vh);
  overflow-y: auto;
}

/* Row */
.wls-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px;
  border-radius: 16px;
}

.wls-lang-row-global {
  background: #f4faf6;
}

.wls-lang-row + .wls-lang-row {
  margin-top: 4px;
}

/* Left side */
.wls-lang-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Flag */
.wls-lang-flag {
  width: 32px;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* For emoji flags in popup */
.wls-lang-flag {
  background: transparent;
  width: auto;
  height: auto;
}

/* Names */
.wls-lang-names {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.wls-lang-country-small {
  font-size: 12px;
  color: #6b7280;
}

.wls-lang-country {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

/* Right side (languages) */
.wls-lang-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: flex-end;
}

.wls-lang-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  color: #14532d;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.wls-lang-link-active {
  font-weight: 600;
}

.wls-lang-link:hover {
  text-decoration-thickness: 2px;
}

/* Scrollbar (optional) */
.wls-lang-list::-webkit-scrollbar {
  width: 6px;
}
.wls-lang-list::-webkit-scrollbar-track {
  background: transparent;
}
.wls-lang-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

/* Responsive */
@media (max-width: 480px) {
  .wls-lang-modal {
    padding: 10px 14px 12px;
    border-radius: 20px;
  }

  .wls-lang-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .wls-lang-right {
    justify-content: flex-start;
  }
}


/* Trigger badge in menu */
.wls-lang-trigger-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.wls-lang-trigger-badge:hover {
  background: #e5e7eb;
  text-decoration: none;
}

.wls-trigger-flag {
  font-size: 16px;
}

.wls-trigger-label {
  font-weight: 500;
}


/* Fancy trigger button (shortcode [wls_fancy_trigger]) */
.wls-fancy-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f4f7fb;
  border: 1px solid #d1d5db;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.10);
  transition: all 0.2s ease;
}

.wls-fancy-trigger:hover {
  background: #e5edf7;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
  text-decoration: none;
}

.wls-fancy-trigger-flag {
  font-size: 18px;
  line-height: 1;
}

.wls-fancy-trigger-label {
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* When used inside classic WP menu items */
.menu-item a.wls-fancy-trigger {
  padding: 6px 14px !important;
}


/* Fancy trigger size variants */
.wls-fancy-trigger--sm {
  padding: 4px 10px;
  font-size: 12px;
}
.wls-fancy-trigger--lg {
  padding: 10px 20px;
  font-size: 15px;
}

/* RTL alignment for fancy trigger */
.wls-fancy-trigger-rtl {
  direction: rtl;
  flex-direction: row-reverse;
}


/* RTL layout for popup when overlay has RTL class */
.wls-lang-overlay-rtl .wls-lang-modal {
  direction: rtl;
}
.wls-lang-overlay-rtl .wls-lang-row {
  flex-direction: row-reverse;
}
.wls-lang-overlay-rtl .wls-lang-right {
  justify-content: flex-start;
}


/* Hide trigger inside menus when option is enabled */
.menu .wls-hide-in-menu,
.wp-block-navigation .wls-hide-in-menu {
  display: none !important;
}

/* Region header inside list */
.wls-lang-section {
  display: flex;
  align-items: center;
  padding: 10px 10px 4px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  cursor: pointer;
}

.wls-lang-section:hover {
  color: #111827;
}

.wls-lang-region-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Collapsed state */
.wls-lang-section.is-collapsed .wls-lang-region-label::after {
  content: '▸';
  font-size: 11px;
}

.wls-lang-section .wls-lang-region-label::after {
  content: '▾';
  font-size: 11px;
}

/* Slightly tighter country rows under sections */
.wls-lang-row {
  margin-bottom: 2px;
}

/* Make sure overlay is always on top of theme headers/menus */
.wls-lang-overlay {
  z-index: 999999;
}
