.modal-overlay {
  position: fixed;
  padding: 20px;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 101000;
  height: 100vh;
}

.modal-content {
  background: #FFFFFF;
  padding: 20px;
  border-radius: 12px;
  width: 80%;
  min-width: 600px;
  max-width: 1000px;
  min-height: 460px;
  max-height: 80vh;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-title {
  text-align: center;
}

.modal-body {
  line-height: 1.6;
  min-height: 300px;
  max-height: 500px;
  min-width: 300px;
  border: 1px solid black;
  overflow-y: auto;
}

.modal-html-preview.modal-body {
  line-height: 1.6;
  min-height: 250px;
  max-height: 350px;
  border: 1px solid black;
  padding: 10px;
  overflow-y: auto;
  min-width: 300px;
  margin: 0 auto;

}

.modal-sidebar {
  border-left: 1px solid #ddd;
  padding-left: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  padding-top: 20px;
  margin-block: 10px;
  width: calc(25% - 15px);
}

label {
  font-weight: 500;
  display: block;
  margin-block-end: 6px;
}

.match-info {
  align-self: stretch;
  width: 100%;
}

.match-info-item {
  margin-block: 10px;
}

.modal-actions {
  align-self: flex-end;
}

.modal-sidebar .save-btn {
  align-self: flex-end;
  margin-top: auto;
}

/* New floating X button */
.btn-close {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  background: transparent;
  height: 40px;
  width: 40px;
  border: none;
  font-size: 24px;
  font-weight: 400;
  color: #333;
  cursor: pointer;
  line-height: 1;
  width: auto;
  height: auto;
  z-index: 2000;
}

.btn-close:hover {
  color: red;
}

.modal-textarea {
  width: 100%;
  height: 300px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.wg-span {
  background: rgba(243, 223, 43, 0.534);
  height: auto;
  width: auto;
  border-radius: 3px;
  display: inline-block;
  white-space: nowrap;
  margin-inline-end: 2px;
}

.alt-text-area {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 6px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

button {
  margin-block: 5px;
}

.replace-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.replace-input-wrapper input {
  flex: 1;
  min-width: 0;
}

#bad-words {
  width: 100%;
}

.wg-span.active {
  background: rgba(255, 177, 59, 0.6);
  border-bottom: none;
}

.scan-button {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  margin: 5px !important;
}

.no-restricted-word {
  color: #555;
  font-style: italic;
  background-color: #F9F9F9;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  margin: 10px 0;
  border: 1px dashed #ccc;
  margin-block: 10px;
}

.content-wrapper {
  display: flex;
  gap: 20px;
}

.modal-main {
  width: calc(75% - 15px);
}

body.wordgrd-no-scroll {
  overflow: hidden !important;
}