/* ============================================================
   assets/css/main.css — Bosco Wayfinder Kiosk Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;600&display=swap');

:root {
  --primary: #003087;
  --primary-light: #1a4ba8;
  --accent: #FFD700;
  --accent-dark: #c9a800;
  --bg-panel: rgba(10, 20, 60, 0.88);
  --text-light: #ffffff;
  --text-muted: #b0c4de;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Outfit', sans-serif;
  --font-alt: 'Space Grotesk', sans-serif;
  --header-h: 80px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: var(--font-main);
  background: #0a1428;
  color: var(--text-light);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Map sits BELOW the header — never overlaps it */
#map {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: calc(100vh - var(--header-h));
  z-index: 1;
}

/* Header always on top */
#header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: linear-gradient(to right, rgba(0, 48, 135, 0.95), rgba(10, 20, 60, 0.95));
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.logo-badge {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  margin-right: -10px;
}

.header-text {
  flex: 1;
  margin-left: 20px;
}

#header .header-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

#header .header-text span {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

#header .header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

#clock {
  font-family: var(--font-alt);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}

#date-display {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.4;
}

/* FABs */
#fab-container {
  position: fixed;
  bottom: 40px;
  left: 28px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
  align-items: flex-start;
}

.fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  outline: none;
  box-shadow: var(--shadow);
}

.fab:hover {
  transform: scale(1.12);
  box-shadow: var(--shadow-lg);
}

.fab:active {
  transform: scale(0.95);
}

.fab-search {
  background: var(--primary);
  color: #fff;
}

.fab-calendar {
  background: #1a6b3c;
  color: #fff;
}

.fab-chat {
  background: #7c3aed;
  color: #fff;
}

.fab .fab-label {
  position: absolute;
  left: calc(100% + 12px);
  white-space: nowrap;
  background: var(--bg-panel);
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--transition), transform var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fab:hover .fab-label {
  opacity: 1;
  transform: translateX(0);
}

/* Panels */
.panel {
  position: fixed;
  bottom: 40px;
  left: 100px;
  width: 360px;
  max-height: 70vh;
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: panelIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.panel.active {
  display: flex;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}

.panel-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Search */
#search-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition);
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
}

#search-results {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.result-card:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--accent);
  transform: translateX(4px);
}

.result-card .rc-type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
  display: inline-block;
}

.rc-type-building {
  background: rgba(0, 48, 135, 0.6);
  color: #7eb3ff;
}

.rc-type-office {
  background: rgba(0, 100, 60, 0.6);
  color: #6df0b0;
}

.rc-type-person {
  background: rgba(120, 50, 200, 0.6);
  color: #d4aaff;
}

.result-card .rc-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.result-card .rc-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Info Panel */
#info-panel {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 24px;
  left: auto;
  width: 340px;
  max-height: calc(100vh - var(--header-h) - 32px);
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: panelIn 0.3s ease;
}

/* Dynamically Swaps Side based on Target coordinates */
#info-panel.info-left {
  right: auto;
  left: 100px;
}

#info-panel.active {
  display: flex;
}

.info-photo {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.info-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  border-bottom: 2px solid var(--accent);
}

/* ── Multi-Photo Carousel ── */
.info-photo-carousel {
  position: relative;
  width: 100%;
  height: 180px;
  background: #000;
  flex-shrink: 0;
}

.info-photo-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  border-bottom: 2px solid var(--accent);
  transition: opacity 0.2s ease-in-out;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  z-index: 10;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  color: var(--accent);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.carousel-btn.prev {
  left: 8px;
}

.carousel-btn.next {
  right: 8px;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
}

.carousel-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  margin: 0 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

.info-banner {
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-bottom: 2px solid var(--accent);
  position: relative;
  flex-shrink: 0;
}

.info-banner .info-type-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.info-banner h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.info-banner .info-sub {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.info-body {
  padding: 16px 16px 24px 16px;
  overflow-y: auto;
  flex: 1;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .ir-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-row .ir-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.info-row .ir-value {
  font-weight: 500;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-open {
  background: rgba(22, 163, 74, 0.25);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.status-closed {
  background: rgba(220, 38, 38, 0.25);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-directions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 14px;
  transition: background var(--transition), transform var(--transition);
}

.btn-directions:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* Calendar */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.calendar-nav button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.calendar-nav button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.calendar-nav h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
  margin-bottom: 14px;
}

.cal-day-header {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 4px 0;
  text-transform: uppercase;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.cal-day:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cal-day.today {
  background: var(--primary);
  font-weight: 700;
}

.cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.cal-day.other-month {
  color: rgba(255, 255, 255, 0.3);
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.event-item .ev-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.event-item .ev-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Chat */
#chat-panel {
  width: 360px;
  height: 500px;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: msgIn 0.25s ease;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.bot {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-msg.user {
  background: var(--primary);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-msg .msg-loc-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--accent);
  color: var(--primary);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
}

#chat-input:focus {
  border-color: var(--accent);
}

#chat-send {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

#chat-send:hover {
  background: var(--primary-light);
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Leaflet overrides */
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.7) !important;
  font-size: 10px;
}

.direction-line {
  stroke-dasharray: 10;
  animation: dashAnim 1s linear infinite;
  stroke: var(--primary) !important;
}

@keyframes dashAnim {
  to {
    stroke-dashoffset: -20;
  }
}

.floor-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* ── Calendar events list view (new style) ── */
.cal-date-group {
  margin-bottom: 14px;
}

.cal-date-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ev-location {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 3px;
}

.ev-map-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  background: rgba(0, 48, 135, 0.7);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: background 0.2s;
}

.ev-map-btn:hover {
  background: #003087;
}

/* ── Custom SVG Active Pin Overlay ── */
.map-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.mm-icon {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s, opacity 0.2s;
  transform: scale(0.50);
  transform-origin: center center;
}

.mm-icon:hover {
  transform: scale(1.1);
  z-index: 10;
}

.map-marker.active-pin .mm-icon {
  opacity: 0;
  transform: scale(0.1);
}

.map-marker.active-pin::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  margin-left: -18px;
  width: 36px;
  height: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z' fill='%23003087' stroke='%23ffffff' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='9' r='3.5' fill='%23FFD700'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transform-origin: bottom center;
  animation: pinBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.map-marker.active-pin.is-polygon-target::after {
  display: none !important;
}

.map-marker.routing-child .mm-icon {
  display: none !important;
}

.map-marker.routing-child::after {
  display: none !important;
}

@keyframes pinBounce {
  0% {
    transform: scale(0.5) translateY(10px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.leaflet-tooltip.dist-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-top: -38px !important;
}

.leaflet-tooltip-top.dist-tooltip::before,
.leaflet-tooltip-top.dist-tooltip::after {
  display: none !important;
}

.dist-tooltip-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dist-tooltip-text {
  background: rgba(0, 48, 135, 0.95);
  border: 2px solid #FFD700;
  color: #FFD700;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.dist-tooltip-pin {
  display: none !important;
}

.map-marker.active-pin.hide-pin-svg::after {
  display: block !important;
}

.leaflet-active-marker {
  z-index: 99999 !important;
}

.routing-hidden {
  display: none !important;
}

/* ── Map Layer Switcher ── */
#layer-switcher {
  position: fixed;
  bottom: 0;
  /* Attach directly to the bottom edge */
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  /* Above map but behind Modals/Panels */
  display: flex;
  flex-direction: column;
  /* Stack the toggle and options */
  align-items: center;
  background: var(--bg-panel);
  padding: 0 5px 5px 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  /* Round top edges only */
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

#ls-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 100%;
  padding: 5px 0;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#ls-toggle-btn span {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#ls-toggle-btn:hover {
  color: #fff;
}

#ls-options-container {
  display: flex;
  gap: 10px;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  max-height: 100px;
  opacity: 1;
  overflow: hidden;
}

#layer-switcher.minimized {
  transform: translateX(-50%) translateY(0);
}

#layer-switcher.minimized #ls-options-container {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

#layer-switcher.hidden-by-panel {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 20px);
  pointer-events: none;
}

.ls-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  width: 70px;
  /* Smaller width */
  font-family: var(--font-main);
}

.ls-btn.active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.ls-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.ls-preview {
  width: 100%;
  height: 38px;
  /* Smaller preview box */
  border-radius: 4px;
  background-color: #333;
  background-size: cover;
  background-position: center;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ls-name {
  font-size: 0.6rem;
  /* Smaller text */
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ============================================================
   Virtual On-Screen Keyboard
   ============================================================ */

/* Keyboard trigger button inside input fields */
.input-kb-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-kb-wrap input {
  padding-right: 42px !important;
}

.kb-trigger-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  z-index: 5;
}

.kb-trigger-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent);
  border-color: rgba(255, 215, 0, 0.3);
}

.kb-trigger-btn:active {
  transform: translateY(-50%) scale(0.9);
}

/* Overlay */
.vk-overlay {
  position: fixed;
  bottom: 40px;
  left: 480px;
  z-index: 9000;
  display: none;
  pointer-events: none;
}

.vk-overlay.active {
  display: block;
  pointer-events: auto;
  animation: panelIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Container */
.vk-container {
  width: fit-content;
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px 16px;
}

/* Header */
.vk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}

.vk-title {
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vk-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition), color var(--transition);
}

.vk-close:hover {
  background: rgba(220, 38, 38, 0.3);
  color: #f87171;
}

/* Suggestions */
.vk-suggestions {
  display: flex;
  gap: 8px;
  padding: 0 4px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: wrap;
  justify-content: center;
}

.vk-suggestions::-webkit-scrollbar {
  display: none;
}

.vk-suggestion {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: var(--accent);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.vk-suggestion:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.15);
}

.vk-suggestion:active {
  transform: scale(0.95);
}

/* Key Grid */
.vk-keys {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vk-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

/* Individual Key */
.vk-key {
  min-width: 40px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.1s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.vk-key:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.vk-key:active {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--accent);
  transform: scale(0.92);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.15);
}

/* Space bar */
.vk-key.vk-space {
  flex: 1;
  max-width: 280px;
  min-width: 160px;
}

/* Action keys (shift, backspace, enter, arrows) */
.vk-key.vk-action {
  min-width: 52px;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 15px;
}

.vk-key.vk-action:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Enter / Send key */
.vk-key.vk-enter {
  background: var(--primary);
  border-color: var(--primary-light);
  color: var(--accent);
  min-width: 64px;
}

.vk-key.vk-enter:hover {
  background: var(--primary-light);
  box-shadow: 0 0 12px rgba(0, 48, 135, 0.6);
}

/* Arrow keys */
.vk-key.vk-arrow {
  min-width: 44px;
}

/* Shift active state */
.vk-key.vk-shift-active {
  background: rgba(255, 215, 0, 0.2) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* Disabled keys (in search mode) */
.vk-key.vk-disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* Extra punctuation row (chat only) */
.vk-row-punct {
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.vk-key.vk-punct {
  min-width: 38px;
  height: 36px;
  font-size: 0.85rem;
  background: rgba(120, 50, 200, 0.15);
  border-color: rgba(120, 50, 200, 0.25);
  color: rgba(255, 255, 255, 0.8);
}

.vk-key.vk-punct:hover {
  background: rgba(120, 50, 200, 0.3);
  border-color: rgba(120, 50, 200, 0.5);
}

.vk-key.vk-punct:active {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--accent);
}

/* Chat input wrapper adjustment for keyboard button */
.chat-input-row .input-kb-wrap {
  flex: 1;
}

.chat-input-row .input-kb-wrap input {
  width: 100%;
}