/* =============================================================================
   modals.css: The QR modal, transient toast, and the shared pass-time/confirm
   dialog system.
   ============================================================================= */

/* QR modal */
/*----------*/

#qr-modal-content {
  display: flex;
  justify-content: center;
  padding: 12px 0 20px;
}
#qr-modal-content svg {
  width: 220px;
  height: 220px;
  border: 8px solid #fff;
  border-radius: 4px;
  background: #fff;
  display: block;
}
#qr-modal-close {
  flex: 1;
  margin-top: 8px;
}

/* Toast */
/*-------*/

#toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: rgba(20, 16, 12, 0.97);
  border: 1px solid var(--rb-border);
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 28px;
  font-weight: 600;
  color: var(--rb-text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 100;
  white-space: normal;
  max-width: calc(100vw - 2rem);
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-theme="light"] #toast {
  background: var(--rb-surface);
}

/* Pass Time modal */
/*-----------------*/

#pass-time-modal,
#custom-duration-modal,
#confirm-remove-modal,
#confirm-extinguish-modal,
#confirm-mode-switch-modal,
#confirm-reset-modal,
#confirm-disconnect-modal,
#confirm-viewer-clocks-modal,
#qr-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
#pass-time-modal[hidden],
#custom-duration-modal[hidden],
#confirm-remove-modal[hidden],
#confirm-extinguish-modal[hidden],
#confirm-mode-switch-modal[hidden],
#confirm-reset-modal[hidden],
#confirm-disconnect-modal[hidden],
#confirm-viewer-clocks-modal[hidden],
#qr-modal[hidden] {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}
.modal-inner {
  position: relative;
  background: #1a1510;
  border: 1px solid var(--rb-border);
  border-radius: 8px;
  padding: 22px 24px 20px;
  width: min(360px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  z-index: 1;
}
[data-theme="light"] .modal-inner {
  background: var(--rb-surface);
}
.modal-inner h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--rb-text);
  margin-bottom: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.modal-quick-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.modal-quick-btns button {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.5rem;
}
.modal-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 20px;
}
.modal-input-row input {
  flex: 0 0 76px;
  width: 96px;
  min-width: 0;
  background: transparent;
  border: 1px solid var(--rb-border);
  border-radius: var(--rb-radius);
  color: var(--rb-text);
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
  text-align: center;
}
.modal-input-row input:focus {
  outline: none;
  border-color: var(--rb-accent);
}
.modal-time-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.modal-time-label {
  font-size: 0.75rem;
  color: var(--rb-text-muted);
  white-space: nowrap;
}
#modal-apply {
  flex: 1;
  align-self: flex-start;
  margin-left: auto;
  height: 76px;
}
.modal-body-text {
  font-size: 0.9rem;
  color: var(--rb-text);
  margin-bottom: 20px;
  line-height: 1.5;
}
.modal-footer {
  display: flex;
  gap: 8px;
}
#modal-apply, #custom-duration-apply, #btn-go-live {
  border-color: #4a9;
  color: #4a9;
}
#modal-apply:hover:not(:disabled),
#custom-duration-apply:hover:not(:disabled),
#btn-go-live:hover:not(:disabled) {
  background: #4a9;
  color: #111;
}
#btn-go-live.live-active {
  border-color: #c55;
  color: #c55;
}
#btn-go-live.live-active:hover:not(:disabled) {
  background: #c55;
  color: #fff;
}
#btn-reset {
  border-color: #c55;
  color: #c55;
}
#btn-reset:hover:not(:disabled) {
  background: #c55;
  color: #fff;
}
#modal-cancel,
#custom-duration-cancel,
#confirm-remove-cancel,
#confirm-extinguish-cancel,
#confirm-mode-switch-cancel,
#confirm-reset-cancel,
#confirm-disconnect-cancel {
  flex: 1;
}
#confirm-remove-ok,
#confirm-extinguish-ok,
#confirm-mode-switch-ok,
#confirm-reset-ok,
#confirm-disconnect-ok,
#confirm-viewer-clocks-ok {
  border-color: #c55;
  color: #c55;
  flex: 1;
}
#confirm-remove-ok:hover:not(:disabled),
#confirm-extinguish-ok:hover:not(:disabled),
#confirm-mode-switch-ok:hover:not(:disabled),
#confirm-reset-ok:hover:not(:disabled),
#confirm-disconnect-ok:hover:not(:disabled),
#confirm-viewer-clocks-ok:hover:not(:disabled) {
  background: #c55;
  color: #fff;
}
