/* ---------------------------------------------------------------------------
   Shared structural styles for app widgets and the unlock control panel.
   Loaded by both the guide and slides pages (see assets.rs: CB_WIDGETS_CSS_PATH).
   Theme-specific overrides (colors, backgrounds) live in guide.css / slides.css.
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   App widgets (.cb-app, cb-cpu-burst, cb-counter)
   --------------------------------------------------------------------------- */

.cb-app {
  margin: 1rem 0;
}

cb-file {
  display: block;
  position: relative;
}

cb-file > pre {
  margin: 0;
}

.cb-file-path {
  position: absolute;
  z-index: 1;
  top: -5px;
  left: 0.9rem;
  padding: 0.12em 0.55em;
  border: 1px solid var(--cb-teal, #5fc8be);
  border-radius: 4px;
  background: var(--cb-ink, #2d2926);
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.25;
}

.cb-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45em 1.1em;
  background: var(--cb-teal, #5fc8be);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.cb-app-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cb-app-btn:hover:not(:disabled) {
  opacity: 0.85;
}

.cb-app-input {
  width: 5rem;
  margin-right: 0.5rem;
  padding: 0.25rem 0.4rem;
  font: inherit;
}

.cb-app-status,
.cb-app-value {
  display: inline-block;
  margin-left: 0.75em;
  font-size: 0.9rem;
  vertical-align: middle;
}

/* ---------------------------------------------------------------------------
   Locked widget — dimmed, non-interactive, lock symbol overlay
   --------------------------------------------------------------------------- */

.cb-app-locked {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
/* Dim and disable the real controls; the overlay catches the click. */
.cb-app-locked > * {
  opacity: 0.4;
  filter: grayscale(60%);
  pointer-events: none;
}
.cb-app-locked::after {
  content: "🔒";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Unlock modal — centered overlay
   --------------------------------------------------------------------------- */

#cb-unlock-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  font-family: inherit;
}
#cb-unlock-overlay[hidden] {
  display: none;
}
#cb-unlock-modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(90vw, 360px);
}
#cb-unlock-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--cb-grey, #75787b);
  cursor: pointer;
}
#cb-unlock-close:hover {
  color: var(--cb-ink, #2d2926);
}
#cb-unlock-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--cb-ink, #2d2926);
}
#cb-unlock-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--cb-grey, #75787b);
}
#cb-unlock-modal label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cb-ink, #2d2926);
}
#cb-unlock-input {
  padding: 0.45em 0.6em;
  border: 1px solid var(--cb-border, #e2e6e8);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}
#cb-unlock-actions {
  display: flex;
  gap: 0.5rem;
}
#cb-unlock-actions button {
  padding: 0.4em 1em;
  border: none;
  border-radius: 4px;
  background: var(--cb-teal, #5fc8be);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
#cb-unlock-actions button:hover {
  opacity: 0.85;
}
#cb-unlock-status {
  font-size: 0.8rem;
  color: var(--cb-grey, #75787b);
  min-height: 1em;
}
