/* =====================================================
   GLOBAL MODAL SYSTEM (APPLIES TO ALL MODALS)
   ===================================================== */

/* Prevent background scroll while modal is open */
body.modal-open {
  overflow: hidden;
}

/* Modal backdrop */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.modal.show {
  display: flex;
}

/* =====================================================
   SHARED MODAL PANEL (BASE LOOK)
   ===================================================== */

.modal-content {
  background-color: #fff;
  padding: 20px 25px;
  border-radius: 12px;
  width: auto;          /* 🔥 remove hard lock */
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  position: relative;
}

/* Close button (default) */
.close {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #888;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

/* =====================================================
   MODAL: SHOW MESSAGE
   (Restores original centered + compact look)
   ===================================================== */

#modal_message .modal-content {
  width: 380px;
  text-align: center;
  padding: 18px 22px;
}

#modal_message #modal_text {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

/* =====================================================
   MODAL: ADD ESPECIALISTA (CENTERED CONTENT)
   ===================================================== */

#add_modal .modal-content {
  min-width: 420px;
  width: 50vw;
  max-width: 600px;
}

/* Center the title */
#add_modal h3 {
  text-align: center;
  margin-bottom: 15px;
}

/* Center labels and inputs vertically */
#add_modal label {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-weight: 600;
}

/* Keep inputs readable and centered */
#add_modal input {
  display: block;
  width: 90%;
  margin: 6px auto 0;
  padding: 6px 8px;
  box-sizing: border-box;
}

/* Buttons row stays spaced */
#add_modal > .modal-content > div {
  margin-top: 20px;
}

/* =====================================================
   MODAL: MATERIAL SEARCH
   ===================================================== */

#material_modal .modal-content {
  width: 420px;
}

#material_modal_list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
}

#material_modal_list li {
  padding: 6px 8px;
  cursor: pointer;
}

#material_modal_list li:hover {
  background-color: #e0e0e0;
}

#material_modal_list li.selected {
  background-color: #007bff;   /* Blue highlight */
  color: #fff;                 /* White text */
}
#material_modal_list li:hover {
  background-color: #e0e0e0;   /* Light gray on hover */
  cursor: pointer;
}

/* ===============================
   IQX MODAL – CENTERED FORM
   =============================== */

#iqx_modal .modal-content {
  width: 50vw;
  max-width: 700px;
  min-width: 520px;
}

/* Center title */
#iqx_modal h2 {
  text-align: center;
  margin-bottom: 18px;
}

/* Form layout – tighter spacing */
#iqx_modal form {
  display: flex;
  flex-direction: column;
  gap: 10px; /* reduced from 14px */
}

/* Label block */
#iqx_modal label {
  display: flex;
  flex-direction: column;
  align-items: center;   /* centers text + field */
  font-size: 14px;
  font-weight: 600;
}

/* Inputs & selects – SAME SIZE */
#iqx_modal input,
#iqx_modal select {
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  width: 90%;
  max-width: 90%;
  min-width: 90%;
  box-sizing: border-box;
  display: block;
}

/* Disabled selects */
#iqx_modal select:disabled {
  background-color: #f5f5f5;
  color: #666;
}

/* Submit button row */
#iqx_modal form > div {
  text-align: right;
  margin-top: 14px;
}

/* Submit button */
#iqx_modal button {
  padding: 8px 16px;
  font-size: 15px;
  border-radius: 6px;
  border: 1px solid #444;
  cursor: pointer;
}
