/*
 * Cadence — Digital Sheet Music Management Platform
 * Copyright © DoubTech. The LICENSE file in the repo root governs use of this file.
 *
 * annotations-share.css — Styles for the multi-user layer picker dropdown and the
 * annotation-sharing panel (annotations-share-ui.js). The picker sits in the
 * rehearsal topbar as a small "Layers" button that opens a floating checklist of
 * annotation layers with colour swatches and toggle checkboxes. The share panel
 * opens below a "Share" button and presents scope radios (Private / Whole band /
 * Specific members) with a member checklist and a Save action.
 */

/* ── Layer picker ──────────────────────────────────────────────────────────── */

.anno-layer-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* The "Layers" toggle button inherits .anno-tool base styles from annotations.css. */
.anno-layers-btn {
  /* No extra styles needed beyond .anno-tool from annotations.css. */
}

/* Floating dropdown panel. */
.anno-layers-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  min-width: 180px;
  background: #1a1c23;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  padding: 6px 0;
}

/* One row per layer: [checkbox] [swatch] [name]. */
.anno-layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.4;
  color: inherit;
}

.anno-layer-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.anno-layer-check {
  flex-shrink: 0;
  cursor: pointer;
}

/* 12×12 circle showing the layer's owner colour. */
.anno-layer-swatch {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
}

.anno-layer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Share control ─────────────────────────────────────────────────────────── */

.anno-share-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* The "Share" button inherits .anno-tool styles from annotations.css. */
.anno-share-btn {
  /* No extra styles needed beyond .anno-tool. */
}

/* Floating share panel. */
.anno-share-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 1000;
  min-width: 220px;
  background: #1a1c23;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  padding: 12px 14px;
  font-size: 0.85rem;
}

.anno-share-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.anno-share-radios {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.anno-share-scope-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Members checklist (revealed when "Specific members" is selected). */
.anno-share-members {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 8px;
}

.anno-share-member-row {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anno-share-no-members {
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.anno-share-loading {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* Footer: save button + status message side-by-side. */
.anno-share-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.anno-share-save {
  flex-shrink: 0;
}

.anno-share-status {
  margin: 0;
  font-size: 0.8rem;
  flex: 1;
}

.anno-share-ok {
  color: #6ee87a;
}

.anno-share-err {
  color: #f87171;
}
