/* ============================================================
   MODALS — BOX, ACTIONS, INPUTS, ANIMATIONS
   ============================================================ */

/* MODAL BOX */
.modal-box {
  width: 360px;
  background: var(--color-surface);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  margin: 120px auto;
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  animation: bubbleIn var(--normal) var(--ease-out);
}

.modal-box.closing {
  animation: bubbleOut var(--normal) var(--ease-in);
}

.modal-box h2 {
  font-size: var(--font-xl);
  font-weight: var(--weight-semibold);
}

/* MODAL INPUT */
.modal-input {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-dark);
  font-size: var(--font-md);
  transition: 0.2s ease;
}

.modal-input:focus {
  border-color: var(--color-text-muted);
  outline: none;
}
#modal-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none; /* modal-box handles clicks */
  z-index: 600;         /* above overlay */
}

/* ============================================
   CLEAN BLUR OVERLAY (GLOBAL MODAL BACKDROP)
============================================ */
#overlay-blur {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);      /* start transparent */
  backdrop-filter: blur(0px);     /* start no blur */
  opacity: 0;
  pointer-events: none;
  transition:
    backdrop-filter 0.25s var(--ease-out),
    background 0.25s var(--ease-out),
    opacity 0.25s var(--ease-out);
  z-index: 500;                   /* above app, below modal */
}

#overlay-blur.active {
  background: rgba(0,0,0,0.25);   /* darken */
  backdrop-filter: blur(12px);    /* blur */
  opacity: 1;
  pointer-events: auto;
}


/* ACTIONS */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.modal-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  font-size: var(--font-md);
  transition: 0.2s ease;
}

/* CANCEL BUTTON */
.modal-btn.cancel {
  background: #f2f2f2;
  color: var(--color-text);
}

.modal-btn.cancel:hover {
  background: #e5e5e5;
}

/* PRIMARY BUTTON */
.modal-btn.create {
  background: var(--color-accent);
  color: #fff;
}

.modal-btn.create:hover {
  background: var(--color-accent-hover);
}

.modal-btn:disabled {
  opacity: 0.6;
  cursor: default;
}



/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bubbleOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
}
