/* =====================================================
   Command Palette for Flare native search
   ===================================================== */

/* ----- Trigger button -------------------------------------------- */
/* position:absolute inside .navigation-wrapper (position:relative).
   We avoid top/transform calculations that depend on the wrapper's
   runtime height (which changes when TnHeader.js injects the navbar).
   Instead we use a fixed pixel offset from the top that matches the
   nav bar's known min-height of 60px: (60px - button height ~32px) / 2 = 14px */
.cmd-palette-trigger {
  position: absolute;
  right: 0;
  top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  background: #fff;
  border: 1.5px solid #E7FF00;
  border-radius: 0;
  color: #888;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
  z-index: 101;
}

.cmd-palette-trigger:hover,
.cmd-palette-trigger:focus-visible {
  background: #fff;
  color: #555;
  outline: none;
}

.cmd-palette-trigger svg {
  flex-shrink: 0;
  opacity: 0.7;
  color: #888;
}

.cmd-palette-trigger__label {
  min-width: auto;
}

.cmd-palette-trigger__kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 4px;
  border: 1px solid #d0d0d0;
  border-radius: 0;
  font-size: 10px;
  font-family: inherit;
  background: #f5f5f5;
  color: #888;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin-left: 50px;
}

@media (max-width: 900px) {
  .cmd-palette-trigger__label,
  .cmd-palette-trigger__kbd {
    display: none;
  }
  .cmd-palette-trigger {
    padding: 6px 8px;
    margin-left: 4px;
  }
}

@media (max-width: 600px) {
  .cmd-palette-trigger {
    display: none;
  }
}

/* ----- Overlay backdrop ------------------------------------------ */
/* z-index must beat Foundation's sticky nav (z-index:1000) and
   MadCap's sidenav overlays                                          */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
  padding-left: 16px;
  padding-right: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.cmd-palette-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ----- Modal box -------------------------------------------------- */
.cmd-palette-modal {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.18s ease;
  display: flex;
  flex-direction: column;
}

.cmd-palette-overlay.is-open .cmd-palette-modal {
  opacity: 1;
}

/* ----- Search input row ------------------------------------------ */
.cmd-palette-input-row {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #fff;
  flex-shrink: 0;
  position: relative;
}

.cmd-palette-input-row svg {
  color: #888;
  flex-shrink: 0;
  margin-right: 12px;
}

.cmd-palette-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: #192124;
  background: transparent;
  padding: 18px 0;
  line-height: 1.4;
  /* Override any Flare skin styles on input */
  box-shadow: none !important;
  height: auto !important;
}

.cmd-palette-input::placeholder {
  color: #aaa;
}

/* Yellow accent line under input */
.cmd-palette-input-row::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #E7FF00;
  z-index: 0;
}

/* Loading bar */
.cmd-palette-loading-bar {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #E7FF00;
  z-index: 1;
  overflow: hidden;
}

.cmd-palette-input-row.cmd-loading .cmd-palette-loading-bar {
  display: block;
}

.cmd-palette-loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: #192124;
  animation: cmd-loading-sweep 1s linear infinite;
}

@keyframes cmd-loading-sweep {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Clear button */
.cmd-palette-clear {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #aaa;
  flex-shrink: 0;
  line-height: 1;
}

.cmd-palette-clear:hover { color: #192124; }

.cmd-palette-input-row.has-value .cmd-palette-clear {
  display: flex;
  align-items: center;
}

/* ----- Results list ---------------------------------------------- */
#cmdPaletteResults {
  overflow-y: auto;
  flex: 1 1 auto;
  background: #fff;
}

.cmd-results-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.cmd-result-item {
  border-bottom: 1px solid #f0f0f0;
}

.cmd-result-item:last-child { border-bottom: none; }

.cmd-result-link {
  display: flex;
  flex-direction: column;
  padding: 10px 20px;
  text-decoration: none !important;
  transition: background 0.1s ease;
  cursor: pointer;
}

.cmd-result-link:hover {
  background: #f5f5f5;
  text-decoration: none !important;
}

.cmd-result-title {
  font-size: 14px;
  font-weight: 600;
  color: #192124 !important;
  line-height: 1.4;
  text-decoration: none !important;
}

.cmd-result-desc {
  font-size: 14px;
  color: #5B6062;
  margin-top: 3px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Status message */
.cmd-palette-status {
  padding: 20px;
  font-size: 13px;
  color: #888;
  text-align: center;
}

/* ----- Footer ---------------------------------------------------- */
.cmd-palette-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-top: 1px solid #e8e8e8;
  background: #fafafa;
  font-size: 12px;
  color: #888;
  flex-shrink: 0;
}

.cmd-view-all {
  font-size: 13px !important;
  font-weight: 400;
  color: #888 !important;
  text-decoration: none !important;
  margin-right: auto;
  visibility: hidden;
  transition: color 0.12s ease;
}

.cmd-view-all.is-visible { visibility: visible; }

.cmd-view-all:hover {
  color: #192124 !important;
  text-decoration: none !important;
}

.cmd-palette-footer kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid #d0d0d0;
  border-radius: 0;
  font-size: 11px;
  background: #fff;
  color: #555;
  font-family: inherit;
}
