/*
 * pocits-compass.css — Compass panel styles (v1, POCITS-only)
 * Canonical: COMPASS-CANONICAL-20260611.md
 *
 * Mobile: full-screen fixed takeover
 * Desktop (≥768px): 380px wide, square corners, snaps to ticker-bar bottom edge
 */

/* ── Panel container ──────────────────────────────────────────────── */
.compass-panel {
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: var(--dropdown-bg, #1a1a2e);
  display: none;
  flex-direction: column;
  overflow: hidden;
  /* Mobile: full viewport */
}

.compass-panel.compass-panel--open {
  display: flex;
}

/* ── Desktop override ─────────────────────────────────────────────── */
@media (min-width: 768px) {
  .compass-panel {
    /* top/left/max-height are set by JS at open time (header.getBoundingClientRect) */
    top: 80px; /* fallback — JS overrides immediately */
    right: auto;
    bottom: auto;
    width: 380px;
    max-height: calc(100vh - 80px);
    border-radius: 0 0 6px 0;
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow-y: auto;
  }
}

/* ── Panel header ─────────────────────────────────────────────────── */
.compass-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.compass-panel__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
}

.compass-panel__avatar svg {
  width: 20px;
  height: 20px;
}

.compass-panel__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  flex: 1;
}

.compass-panel__close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compass-panel__close:hover {
  color: rgba(255,255,255,0.9);
}

/* ── Switcher row (PLACES · PROJECT · PLATFORM) ───────────────────── */
.compass-panel__switcher {
  display: flex;
  gap: 0;
  padding: 14px 20px 0;
  flex-shrink: 0;
}

.compass-panel__tile {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 6px 10px 8px;
  transition: color 0.15s, border-color 0.15s;
  flex: 1;
}

.compass-panel__tile:hover {
  color: rgba(255,255,255,0.7);
}

.compass-panel__tile--active {
  color: var(--hub-primary, #F59E0B);
  border-bottom-color: var(--hub-primary, #F59E0B);
}

/* ── Icon array ───────────────────────────────────────────────────── */
.compass-panel__array {
  display: none;
  flex-direction: column;
  padding: 16px 20px 0;
}

.compass-panel__array--active {
  display: flex;
}

/* Icons row: single scrollable row on mobile */
.compass-panel__icons-wrap {
  position: relative;
  overflow: hidden;
}

.compass-panel__icons {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.compass-panel__icons::-webkit-scrollbar {
  display: none;
}

/* Right-edge scroll fade hint */
.compass-panel__icons-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--dropdown-bg, #1a1a2e));
  pointer-events: none;
  transition: opacity 0.2s;
}

.compass-panel__icons-wrap.no-overflow .compass-panel__icons-fade {
  opacity: 0;
}

/* ── Individual icon ──────────────────────────────────────────────── */
.compass-panel__icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  border-radius: 6px;
  flex-shrink: 0;
  min-width: 44px;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}

a.compass-panel__icon:hover:not(.compass-panel__icon--disabled):not(.compass-panel__icon--active) {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.05);
}

.compass-panel__icon--active {
  color: var(--hub-primary, #F59E0B);
}

/* Non-functional icons: greyed, no pointer */
.compass-panel__icon--disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}

@media (min-width: 768px) {
  /* Re-enable pointer events on desktop for the title tooltip */
  .compass-panel__icon--disabled {
    pointer-events: auto;
    cursor: default;
  }
}

.compass-panel__icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.compass-panel__icon-badge svg {
  width: 20px;
  height: 20px;
}

.compass-panel__icon-label {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  line-height: 1;
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Array label ──────────────────────────────────────────────────── */
.compass-panel__array-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.20);
  margin: 6px 0 14px;
  text-align: center;
}

/* ── Search input ─────────────────────────────────────────────────── */
.compass-panel__search {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  overflow: hidden;
  margin: 0 0 20px;
  flex-shrink: 0;
}

.compass-panel__search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  padding: 10px 12px;
  min-width: 0;
}

.compass-panel__search-input::placeholder {
  color: rgba(255,255,255,0.25);
}

.compass-panel__search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.40);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.compass-panel__search-btn:hover {
  color: rgba(255,255,255,0.80);
}

/* ── Search typeahead dropdown ────────────────────────────────────── */
.compass-panel__search-drop {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  margin: -12px 0 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

.compass-panel__search-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  text-decoration: none;
  color: rgba(255,255,255,0.80);
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.12s;
}

.compass-panel__search-result:last-child {
  border-bottom: none;
}

.compass-panel__search-result:hover,
.compass-panel__search-result--focused {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.compass-panel__search-result-geo {
  font-size: 10px;
  color: rgba(255,255,255,0.32);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Fallback (no compass_config) ─────────────────────────────────── */
.compass-panel__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 20px;
}

.compass-panel__fallback-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.15s;
}

.compass-panel__fallback-link:hover {
  color: rgba(255,255,255,0.90);
}

.compass-panel__fallback-sep {
  color: rgba(255,255,255,0.20);
  font-size: 14px;
}

/* ── Mobile swipe-down hint: subtle top handle ─────────────────────── */
@media (max-width: 767px) {
  .compass-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
}
