/* SmartCluster — shared switcher dropdown
 * Použiteľný naprieč v1–v6, themable cez CSS custom properties.
 */

.switcher {
  position: relative;
  font-family: inherit;
  z-index: 60;
}

.switcher > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 14px;
  background: var(--sw-bg, rgba(0,0,0,0.04));
  border: 1px solid var(--sw-border, rgba(0,0,0,0.12));
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sw-fg, currentColor);
  cursor: pointer;
  list-style: none;
  user-select: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.switcher > summary::-webkit-details-marker { display: none; }
.switcher > summary::marker { display: none; content: ''; }
.switcher > summary:hover {
  background: var(--sw-bg-hover, rgba(0,0,0,0.08));
  border-color: var(--sw-border-hover, rgba(0,0,0,0.2));
}
.switcher[open] > summary {
  background: var(--sw-bg-active, rgba(0,0,0,0.1));
  border-color: var(--sw-border-active, rgba(0,0,0,0.25));
}

.switcher-label {
  opacity: 0.65;
}

.switcher-current {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.switcher-caret {
  transition: transform .2s ease;
  opacity: 0.5;
}
.switcher[open] .switcher-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.switcher-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  background: var(--sw-menu-bg, #ffffff);
  color: var(--sw-menu-fg, #1a1a1a);
  border: 1px solid var(--sw-menu-border, rgba(0,0,0,0.1));
  border-radius: 14px;
  box-shadow: 0 16px 48px -16px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.08);
  padding: 8px;
  font-family: var(--sw-menu-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  animation: switcherFadeIn .14s ease-out;
}

@keyframes switcherFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.switcher-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition: background .12s;
  line-height: 1.3;
}
.switcher-menu a:hover {
  background: var(--sw-menu-hover, rgba(0,0,0,0.05));
}
.switcher-menu a .sw-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--sw-num-bg, rgba(0,0,0,0.06));
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  flex-shrink: 0;
}
.switcher-menu a .sw-name {
  flex: 1;
}
.switcher-menu a.is-current {
  background: var(--sw-current-bg, #1e40af);
  color: var(--sw-current-fg, #fff);
  font-weight: 600;
}
.switcher-menu a.is-current .sw-num {
  background: rgba(255,255,255,0.2);
}
.switcher-menu a.is-current::after {
  content: '●';
  font-size: 10px;
  opacity: 0.6;
}

.switcher-divider {
  height: 1px;
  background: var(--sw-menu-border, rgba(0,0,0,0.08));
  margin: 6px 0;
}

.switcher-back {
  font-size: 11px !important;
  color: var(--sw-menu-muted, #737373) !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Mobile */
@media (max-width: 640px) {
  .switcher-menu {
    right: -8px;
    min-width: 240px;
  }
  .switcher-label { display: none; }
}

/* Themes — variants override via :root or .switcher-themed class */

/* Dark themed (pre tmavé varianty: v2, v6) */
.switcher-dark > summary {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.95);
}
.switcher-dark > summary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}
.switcher-dark[open] > summary {
  background: rgba(255,255,255,0.16);
}
.switcher-dark .switcher-menu {
  background: #161616;
  color: #fafafa;
  border-color: rgba(255,255,255,0.1);
}
.switcher-dark .switcher-menu a:hover {
  background: rgba(255,255,255,0.06);
}
.switcher-dark .switcher-menu a .sw-num {
  background: rgba(255,255,255,0.1);
}
.switcher-dark .switcher-divider {
  background: rgba(255,255,255,0.1);
}
.switcher-dark .switcher-back {
  color: rgba(255,255,255,0.5) !important;
}
