/* ==================== Modal ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  align-items: center;
  justify-content: center;

  &.active {
    display: flex;
  }

  & .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
  }

  & .modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 34rem;
    padding: 1.25rem;
    animation: slideUp 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.125rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);

  & h2 {
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
  }
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;

  &:hover {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text);
  }
}

.delete-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;

  &[hidden] {
    display: none;
  }

  & .delete-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(4px);
  }

  & .delete-dialog-content {
    position: relative;
    width: min(calc(100% - 2rem), 24rem);
    padding: 1.35rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text);
    background: var(--card-bg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: slideUp 180ms ease-out;

    & > i {
      display: grid;
      place-items: center;
      width: 2.5rem;
      height: 2.5rem;
      margin: 0 auto 0.7rem;
      border-radius: var(--radius-sm);
      color: var(--danger-color);
      background: color-mix(in srgb, var(--danger-color) 12%, transparent);
      font-size: 1.15rem;
    }

    & h2 {
      font-size: 1.05rem;
    }

    & p {
      margin-top: 0.45rem;
      color: var(--text-muted);
      font-size: 0.8rem;
      line-height: 1.5;
    }
  }

  & .delete-dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 1.1rem;

    & button {
      min-height: 2.6rem;
    }
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}