/* Fullscreen dark overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050; /* make sure it's above everything */
}

/* Modal box */
.add-template .modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1060;
}

/* Form fields */

/* Actions row */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-actions button[type="submit"] {
  background: black;
  color: white;
}

.modal-actions button[type="button"] {
  background: #ddd;
}

.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-label {
  visibility: hidden;
  opacity: 0;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 11px;
  position: absolute;
  z-index: 10;
  bottom: 125%; /* show above button */
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: opacity 0.2s ease-in-out;
}

.tooltip-wrapper:hover .tooltip-label {
  visibility: visible;
  opacity: 1;
}

/* Modal overlay & content */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  width: 600px;
  max-width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  padding: 20px;
}

.modal-header h6 {
  margin: 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.add-template input[type="text"],
.add-template input[type="email"],
.add-template input[type="password"],
.add-template input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  box-sizing: border-box;
}

.add-template input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn svg {
  stroke: #555;
}

.close-btn:hover svg {
  stroke: #000;
}



/* Placeholder info */
.placeholders-info {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 10px;
}

.placeholders-info span {
  font-weight: 500;
  margin-right: 5px;
}

.placeholders-info::after {
  content: "";
  display: block;
  margin-top: 4px;
}

/* ReactQuill editor */
.ql-container {
  min-height: 150px;
  margin-bottom: 12px;
}

/* Copy to assistants checkbox */
.checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.checkbox input[type="checkbox"] {
  margin-right: 8px;
}

/* Attachments */
.attachments button {
  background: #f1f1f1;
  border: 1px solid #ccc;
  padding: 4px 8px;
  margin-bottom: 8px;
  border-radius: 5px;
  cursor: pointer;
}

.attachments ul {
  list-style: none;
  padding-left: 0;
  margin-top: 5px;
}

.attachments li {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.attachments li button {
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  color: #888;
}

/* Footer buttons */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.modal-footer .btn-primary {
  background-color: #D9A128;
  border: none;
  padding: 8px 16px;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.modal-footer .btn-primary:hover {
  background-color: #D9A128;
}

.modal-footer .btn-secondary {
  background-color: #6c757d;
  border: none;
  padding: 8px 16px;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.modal-footer .btn-secondary:hover {
  background-color: #5c636a;
}
