/* ── Unified Modal ──────────────────────────────── */
.lumora-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lumora-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.lumora-modal-box {
  background: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 1rem;
  width: 100%;
  max-width: 28rem;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 1.25rem 3.75rem rgba(0,0,0,0.6);
  transform: scale(0.92) translateY(0.5rem);
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
  position: relative;
}
.lumora-modal-overlay.open .lumora-modal-box {
  transform: scale(1) translateY(0);
}

.lumora-modal-box.lumora-modal-sheet {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 1.25rem 1.25rem 0 0;
  margin-top: auto;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.lumora-modal-overlay.open .lumora-modal-box.lumora-modal-sheet {
  transform: translateY(0);
}

/* Sheet drag handle */
.lumora-modal-handle {
  width: 2.5rem; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

/* Modal icon */
.lumora-modal-icon {
  width: 3rem; height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.25rem;
}

/* Modal title */
.lumora-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--light-text, #fff);
  text-align: center;
}

/* Modal body text */
.lumora-modal-body {
  font-size: 0.88rem;
  color: var(--muted-text, #888);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  text-align: center;
}

/* Modal actions */
.lumora-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.lumora-modal-actions .lumora-modal-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}
.lumora-modal-actions .lumora-modal-btn:active {
  transform: scale(0.97);
}
.lumora-modal-actions .lumora-modal-btn-secondary {
  background: rgba(255,255,255,0.07);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.08);
}
.lumora-modal-actions .lumora-modal-btn-secondary:hover {
  background: rgba(255,255,255,0.12);
}
.lumora-modal-actions .lumora-modal-btn-primary {
  background: var(--accent, #8e2de2);
  color: #fff;
}
.lumora-modal-actions .lumora-modal-btn-primary:hover {
  filter: brightness(1.1);
}
.lumora-modal-actions .lumora-modal-btn-danger {
  background: #ef4444;
  color: #fff;
}
.lumora-modal-actions .lumora-modal-btn-danger:hover {
  filter: brightness(1.1);
}

/* Modal close X */
.lumora-modal-x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: none;
  color: #888;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}
.lumora-modal-x:hover {
  background: rgba(255,255,255,0.12);
}

/* ── Light mode overrides ── */
body.light .lumora-modal-overlay {
  background: rgba(0,0,0,0.35);
}
body.light .lumora-modal-box {
  background: #fff;
  border-color: #e0e0e0;
}
body.light .lumora-modal-title {
  color: #111;
}
body.light .lumora-modal-body {
  color: #555;
}
body.light .lumora-modal-actions .lumora-modal-btn-secondary {
  background: rgba(0,0,0,0.05);
  color: #333;
  border-color: rgba(0,0,0,0.1);
}
body.light .lumora-modal-actions .lumora-modal-btn-secondary:hover {
  background: rgba(0,0,0,0.1);
}
