/* ===== CSS styles for the UMAP FLOATING WINDOW ===== */
/* This is referred to as the "semantic map" in the user documentation */

#umapFloatingWindow {
  position: fixed;
  z-index: 1000;
  display: none;
  top: 8px;
  right: 8px;
  /* background: rgba(24, 24, 32, 0.75) !important; */
  background: rgb(24, 24, 32) !important;
  color: #eee;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  min-width: 200px;
  min-height: 200px;
  width: auto;
  height: auto;
  overflow: hidden;
  padding: 4px;
  max-width: 100vw !important;
  max-height: 100vh !important;
  padding-bottom: 20px;
}

.icon-btn {
  background: none;
  border: none;
  padding: 6px;
  margin: 0 4px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}

.icon-btn:hover,
.icon-btn:focus {
  background: rgba(255, 255, 255, 0.12);
}

.icon-btn.active {
  box-shadow:
    0 0 8px 2px #4caf50,
    0 0 16px 4px #2196f3;
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid #4caf50;
  z-index: 2;
}

#umapTitlebar {
  cursor: move;
  background: rgba(30, 30, 40, 0.95);
  color: #fff;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 8px 8px 0 0;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1em;
}

.umap-titlebar-left {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  /* Was on the select itself before the reindex button joined it. */
  max-width: 60%;
}

#umapReindexBtn {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  margin: 0;
}

/* Progress ring shown in place of the reindex button while indexing runs.
   The fill arc is driven from JS via stroke-dashoffset (circumference 2πr,
   r=8 → 50.27); the -90° rotation starts the arc at 12 o'clock. */
.umap-reindex-progress {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  cursor: default;
}

.umap-reindex-progress svg {
  transform: rotate(-90deg);
}

.umap-reindex-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 3;
}

.umap-reindex-ring {
  fill: none;
  stroke: #ff9800;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 50.27;
  stroke-dashoffset: 50.27;
  transition:
    stroke-dashoffset 0.3s,
    stroke 0.3s;
}

/* Phases without a meaningful percentage (directory traversal) show a
   spinning quarter arc instead of a fill level. Keyframes: spinners.css. */
.umap-reindex-progress.indeterminate svg {
  animation: umap-spin 1.2s linear infinite;
}

/* The album pulldown (#semanticMapAlbumSelect) is styled by the shared
   .album-select rules in album-select.css, which the album badge in the
   swiper/grid view uses too. */

/* ===== UMAP THUMBNAIL STYLES ===== */
.umap-thumbnail {
  position: fixed;
  z-index: 99999;
  border: 2px solid #222;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
  padding: 12px 12px 0 12px;
  pointer-events: none;
  transition: opacity 0.1s;
  opacity: 0.98;
  min-width: 160px;
  max-width: 260px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: inherit;
  visibility: hidden;
}

.umap-thumbnail img {
  max-width: 240px;
  max-height: 360px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  background: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.umap-thumbnail-filename {
  font-size: 0.95em;
  margin-top: 6px;
  margin-bottom: 2px;
  text-align: center;
  word-break: break-all;
}

.umap-thumbnail-cluster {
  font-size: 0.95em;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.25);
  width: 100%;
  text-align: center;
  border-radius: 0 0 8px 8px;
  padding: 2px 0 4px 0;
  margin-top: 2px;
}

.umap-thumbnail-tags {
  font-size: 0.8em;
  width: 100%;
  text-align: center;
  padding: 2px 8px 4px 8px;
}

.umap-thumbnail-tags .tag-value:first-of-type {
  font-weight: bold;
}

#umapEpsContainer,
#umapColorModeContainer {
  font-size: 0.85em;
}

.umap-info-btn {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(10, 20, 55, 0.85);
  border: 1.5px solid #4a9eff;
  border-radius: 50%;
  width: 1.3em;
  height: 1.3em;
  padding: 0;
  cursor: pointer;
  color: #4a9eff;
  font-size: 0.85em;
  font-style: italic;
  font-weight: bold;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition:
    background 0.15s,
    color 0.15s;
}

.umap-info-btn:hover,
.umap-info-btn:focus {
  background: rgba(20, 50, 120, 0.9);
  color: #80c0ff;
  border-color: #80c0ff;
  outline: none;
}

/* Marks a Cluster Strength the map derived rather than one the user chose.
   Deliberately quiet — it explains the number in the spinner, it is not a
   control. `hidden` is honored explicitly because the flex display on the
   surrounding row would otherwise override it. */
.umap-eps-auto-badge {
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid #4a9eff;
  border-radius: 8px;
  color: #80c0ff;
  font-size: 0.7em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.umap-eps-auto-badge[hidden] {
  display: none;
}

/* The strength the map was actually clustered at, when the server had to
   shrink the requested one to fit its memory budget. The details are in the
   title; the text only has to signal that the spinner's number is not the
   map's. */
.umap-eps-effective {
  margin-left: 4px;
  color: #faea0e;
  font-size: 0.75em;
  cursor: help;
  vertical-align: middle;
}

.umap-eps-effective[hidden] {
  display: none;
}

/* The Cluster Strength field holds something the album cannot be set to — a
   half-typed number, or one below the floor the server would silently raise.
   umap.js answers those by doing nothing, so without a mark a refused
   keystroke and a saved one look the same. Set from JS rather than `:invalid`
   so it never fires on a derived strength that simply exceeds the spinner's
   display `max`, which is a real number the map is clustering with. */
#umapEpsSpinner.umap-eps-unusable {
  border: 1px solid #ff8080;
  outline: none;
}

#umapClickBehaviorContainer,
#umapMediaFilterContainer {
  font-size: 0.85em;
}

#umapClickBehaviorContainer label,
#umapMediaFilterContainer label {
  cursor: pointer;
  user-select: none;
}

#umapClickBehaviorContainer input[type="radio"] {
  cursor: pointer;
}
