/* protocol-popup.css — Hoverable popup for OT-2 protocol code */

/* --- Trigger link styling --- */
.protocol-popup-ref {
  color: var(--link, #256);
  text-decoration: none;
  border-bottom: 1px dotted var(--link, #256);
  cursor: pointer;
}
.protocol-popup-ref:hover {
  border-bottom-style: solid;
}

/* --- Popup container --- */
.protocol-popup {
  position: absolute;
  z-index: 1001;
  display: flex;
  flex-direction: column;

  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;

  background: var(--bg, #fcfcf8);
  border: 3px double #ccc;
  box-shadow: 1px 2px 8px 0 #ccc;

  opacity: 1;
  transition: none;

  font-family: 'IBM Plex Mono', 'Menlo', monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.protocol-popup.fading {
  opacity: 0;
  transition: opacity 0.25s ease-in 0.1s;
}

.protocol-popup.focused {
  border-color: #aaa;
  box-shadow: 1px 2px 8px 0 #aaa;
}

/* --- Title bar --- */
.protocol-popup-title-bar {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 1.6rem;
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid #ddd;
  background-color: #fff;
  background-image: radial-gradient(circle, #e6e6e6 1px, transparent 1px);
  background-size: 8px 8px;
  user-select: none;
}

.protocol-popup.focused .protocol-popup-title-bar {
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-color: #e6e6e6;
}

.protocol-popup-title {
  flex: 1 1 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #aaa;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.protocol-popup.focused .protocol-popup-title {
  color: #555;
}

.protocol-popup-pin,
.protocol-popup-expand,
.protocol-popup-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.3rem;
  line-height: 1;
  color: #bbb;
  transition: color 0.15s;
}
.protocol-popup-pin:hover,
.protocol-popup-expand:hover,
.protocol-popup-close:hover {
  color: #555;
}

.protocol-popup.pinned .protocol-popup-pin {
  color: #b33;
}

/* --- Content area --- */
.protocol-popup-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.75em;
  min-height: 0;
}

/* Reuse code-viewer.css styles for protocol-list, protocol-item, protocol-source */

/* --- Download bar --- */
.protocol-download-bar {
  display: flex;
  justify-content: flex-end;
  padding: 0.3em 0.5em;
  border-bottom: 1px solid #eee;
  background: #f5f5f2;
}
.protocol-download-btn {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: #256;
  text-decoration: none;
  padding: 0.2em 0.5em;
  border-radius: 3px;
}
.protocol-download-btn:hover {
  background: #e8eef4;
}

/* --- Expanded state (when viewing source) --- */
.protocol-popup.expanded {
  max-height: 90vh;
}

/* --- Fullscreen state --- */
.protocol-popup.fullscreen {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: none;
  box-shadow: none;
  z-index: 10000;
}

.protocol-popup.fullscreen .protocol-popup-content {
  max-height: none;
}
