/* ============================================================
   Vibe Code News — Direction Switcher Widget
   Floating pill, dark glass, RTL, keyboard accessible
   ============================================================ */

.vcn-switcher {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0;
  direction: rtl;
  font-family: inherit;
  font-size: 12px;
  line-height: 1;

  background: rgba(15, 15, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 1px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);

  overflow: hidden;
  user-select: none;
}

/* ---- individual link items ---- */
.vcn-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  white-space: nowrap;
  font-family: 'Heebo', 'Arial Hebrew', sans-serif;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  position: relative;
}

.vcn-switcher a:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.07);
}

.vcn-switcher a:focus-visible {
  outline: 2px solid rgba(200, 180, 120, 0.9);
  outline-offset: -2px;
  border-radius: 4px;
  color: #fff;
}

/* ---- home link ---- */
.vcn-switcher-home {
  font-size: 14px;
  padding: 8px 12px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  letter-spacing: 0;
}

.vcn-switcher-home:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* ---- dividers ---- */
.vcn-switcher-div {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  margin: 0;
}

/* ---- direction links group ---- */
.vcn-switcher-dirs {
  display: flex;
  align-items: center;
}

/* ---- page links group ---- */
.vcn-switcher-pages {
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.vcn-switcher-pages a {
  padding: 8px 9px !important;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4) !important;
}

.vcn-switcher-pages a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* ---- active / current state ---- */
.vcn-switcher a.vcn-active {
  color: rgba(255, 255, 255, 0.98);
}

.vcn-switcher a.vcn-active::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(200, 180, 120, 0.85);
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .vcn-switcher a {
    transition: none;
  }
}

/* ============================================================
   Back-to-launcher floating button
   Separate fixed element OUTSIDE the .vcn-switcher pill.
   Mirrored to bottom-right so it never overlaps with the chat
   (which lives in the upper portion per Round 4 constraint)
   and never sits on top of the switcher pill (which is bottom-left).
   ============================================================ */
.vcn-back-to-launcher {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 99999;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 10px 16px;

  font-family: 'Heebo', 'Arial Hebrew', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  direction: rtl;

  background: rgba(15, 15, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.45),
    0 1px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.vcn-back-to-launcher:hover {
  background: rgba(200, 180, 120, 0.92);
  border-color: rgba(255, 255, 255, 0.4);
  color: #1a1a1a;
  transform: translateY(-1px);
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.5),
    0 1px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.vcn-back-to-launcher:focus-visible {
  outline: 2px solid rgba(200, 180, 120, 0.95);
  outline-offset: 2px;
  color: #1a1a1a;
  background: rgba(200, 180, 120, 0.92);
}

.vcn-back-to-launcher:active {
  transform: translateY(0);
}

.vcn-back-to-launcher-arrow {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
  transition: transform 0.18s ease;
}

.vcn-back-to-launcher:hover .vcn-back-to-launcher-arrow {
  transform: translateX(-3px);
}

.vcn-back-to-launcher-label {
  display: inline-block;
}

/* ---- small viewport: shrink button so it doesn't overlap the pill ---- */
@media (max-width: 480px) {
  .vcn-back-to-launcher {
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    padding: 9px 12px;
  }
}

/* ---- very narrow viewport: drop the full label, keep short label ---- */
@media (max-width: 360px) {
  .vcn-back-to-launcher-label {
    /* Compact fallback so the button stays reachable on the smallest phones. */
    font-size: 11px;
  }
}

/* ---- reduced motion (must come AFTER .vcn-back-to-launcher to win specificity) ---- */
@media (prefers-reduced-motion: reduce) {
  .vcn-back-to-launcher,
  .vcn-back-to-launcher-arrow {
    transition: none;
  }
  .vcn-back-to-launcher:hover {
    transform: none;
  }
  .vcn-back-to-launcher:hover .vcn-back-to-launcher-arrow {
    transform: none;
  }
}

/* ---- mid viewport: 25 directions need room — allow wrap ---- */
@media (max-width: 1900px) {
  .vcn-switcher {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
    max-width: calc(100vw - 20px);
    row-gap: 0;
  }
}

/* ---- small viewport: shrink padding ---- */
@media (max-width: 480px) {
  .vcn-switcher {
    font-size: 11px;
    bottom: 10px;
    left: 10px;
  }

  .vcn-switcher a {
    padding: 7px 8px;
  }

  .vcn-switcher-home {
    padding: 7px 10px !important;
  }
}
