/* --- 1. Trigger & Overlay --- */
.jkcm-cs-trigger {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99999;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 20px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jkcm-cs-globe-icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.15em;
  display: none !important;
}

.custom-lang-switcher .jkcm-cs-globe-icon,
.jkcm-cs-trigger .jkcm-cs-globe-icon {
  color: currentColor;
  pointer-events: none;
}

.jkcm-cs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.jkcm-cs-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.jkcm-cs-overlay.is-loading {
  background: rgba(7, 16, 28, 0.52);
}

/* --- 2. Modal Venster --- */
.jkcm-cs-modal {
  width: 100%;
  max-width: 980px;
  height: 85%;
  max-height: 750px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.jkcm-cs-overlay.is-open .jkcm-cs-modal {
  transform: scale(1);
}

.jkcm-cs-overlay.is-loading .jkcm-cs-modal {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  pointer-events: none;
  filter: blur(6px);
}

.jkcm-cs-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.jkcm-cs-overlay.is-loading .jkcm-cs-loading {
  opacity: 1;
  visibility: visible;
}

.jkcm-cs-loading-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  padding: 30px 28px;
  text-align: center;
}

.jkcm-cs-loading-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 4px solid rgba(24, 150, 211, 0.18);
  border-top-color: #1896d3;
  animation: jkcm-cs-spin 0.85s linear infinite;
}

.jkcm-cs-loading-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: #0b1320;
}

.jkcm-cs-loading-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #4d5b6a;
}

@keyframes jkcm-cs-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* --- 3. Titel en Sluitknop --- */
.jkcm-cs-title {
  font-weight: 600;
  font-size: 22px;
  padding: 24px 30px;
  flex-shrink: 0;
  color: #111;
}

.jkcm-cs-close {
  position: absolute;
  top: 18px;
  right: 20px;
  border: 0;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s;
}

.jkcm-cs-close:hover {
  color: #111;
}

/* --- 4. Scrollbaar Grid voor Landen --- */
.jkcm-cs-grid {
  padding: 0 30px 30px 30px;
  flex-grow: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 20px;
}

@media (max-width: 900px) {
  .jkcm-cs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .jkcm-cs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .jkcm-cs-grid {
    grid-template-columns: 1fr;
  }
}

/* Mooiere scrollbar */
.jkcm-cs-grid::-webkit-scrollbar {
  width: 6px;
}

.jkcm-cs-grid::-webkit-scrollbar-track {
  background: #f7f7f7;
}

.jkcm-cs-grid::-webkit-scrollbar-thumb {
  background: #d1d1d1;
  border-radius: 3px;
}

.jkcm-cs-grid::-webkit-scrollbar-thumb:hover {
  background: #b1b1b1;
}

/* --- 5. Land Item & Taal Links --- */
.jkcm-cs-country-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.jkcm-cs-country-flag {
  font-size: 22px;
  line-height: 1;
}

.jkcm-cs-country-name {
  font-weight: 500;
  font-size: 16px;
  color: #111;
  transition:
    color 0.2s,
    font-weight 0.2s;
}

.jkcm-cs-country-langs {
  padding-left: 36px;
}

.jkcm-cs-chip {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  text-decoration: none;
  transition:
    color 0.2s,
    font-weight 0.2s;
  margin-right: 12px;
}

.jkcm-cs-chip:hover {
  color: #1896d3;
  text-decoration: underline;
}

.jkcm-cs-chip.is-disabled {
  color: #ccc;
  cursor: not-allowed;
  text-decoration: none;
}

/* --- Gedetecteerd land highlight --- */
.jkcm-cs-country-item.is-detected {
  background: #f0f8fd;
  border-radius: 8px;
  padding: 6px 8px;
  margin: -6px -8px;
  outline: 2px solid #1896d3;
}

.jkcm-cs-country-item.is-detected .jkcm-cs-country-name {
  color: #1896d3;
  font-weight: 600;
}

/* --- NIEUWE STIJLEN VOOR ACTIEVE SELECTIE --- */
.jkcm-cs-chip.is-active {
  color: #1896d3;
  font-weight: 700;
  /* Dikgedrukt */
}

.jkcm-cs-country-item.country-active .jkcm-cs-country-name {
  color: #1896d3;
  font-weight: 700;
  /* Dikgedrukt */
}

/* --- Verberg de Save knop --- */
.jkcm-cs-save,
.jkcm-cs-footer {
  display: none;
}

/* --- Debug Paneel --- */
.jkcm-cs-debug-panel {
  position: fixed;
  bottom: 16px;
  left: 16px;
  background-color: #111;
  color: #fff;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-family: monospace;
  font-size: 13px;
  z-index: 99998;
  max-width: 300px;
  opacity: 0.95;
}

.jkcm-cs-debug-panel strong {
  color: #5eaef8;
}

.jkcm-cs-debug-panel p {
  margin: 8px 0 0 0;
  padding: 0;
  line-height: 1.4;
}

.jkcm-cs-debug-panel p:first-of-type {
  margin-top: 0;
}
