/* Shared, reusable UI components used across admin.html and index.html. */

/* Modal header: title + close button on one row.
   align-items:center keeps the X on the same midline as the title text. */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  line-height: 1;
}

/* Modal close button ("X").
   Appearance only — place it inside .modal-header next to the title.
   Do not absolutely position it. */
.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #9ca3af; /* gray-400 */
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.modal-close:hover {
  color: #4b5563; /* gray-600 */
  background: rgba(0, 0, 0, 0.05);
}

.dark .modal-close:hover {
  color: #d1d5db; /* gray-300 */
  background: rgba(255, 255, 255, 0.08);
}

.modal-close:focus-visible {
  outline: 2px solid #a855f7; /* purple-500 */
  outline-offset: 2px;
}

.modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

/* Variant for modals on a dark / colored background. */
.modal-close--light {
  color: rgba(255, 255, 255, 0.7);
}

.modal-close--light:hover,
.dark .modal-close--light:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}
