/* ============================================================
   MODAL OVERLAY
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

/* ============================================================
   VENTANA DEL MODAL
============================================================ */
.modal-window {
  background: white;
  width: 420px;               /* un poco mayor para iconos + scroll */
  max-height: 80vh;           /* límite general */
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  animation: modalFadeIn .22s ease;
  font-family: inherit;

  display: flex;
  flex-direction: column;     /* header + body + botones */
  overflow: hidden;           /* evita que sobresalga el scroll */
}

@keyframes modalFadeIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============================================================
   HEADER (ICONO + TÍTULO)
============================================================ */
.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 10px 20px;
}

.modal-icon {
  font-family: "Material Icons";
  font-size: 32px;
  line-height: 32px;
  color: #4175fa;        /* azul simpático: se puede cambiar por tipo */
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: #222;
  margin: 0;
}

/* ============================================================
   BODY CON SCROLL
============================================================ */
.modal-body {
  padding: 0 20px 20px 20px;
  font-size: 1.05rem;
  line-height: 1.45;
  overflow-y: auto;
  max-height: 50vh;          /* scroll interno */
}

/* ============================================================
   BOTONES
============================================================ */
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px 20px 20px;
  flex-shrink: 0;
}

.modal-btn {
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  border: none;
}

/* Botón cancelar */
.modal-btn-cancel {
  background: #ddd;
  color: #333;
}

/* Botón OK / aceptar */
.modal-btn-ok {
  background: #4175fa;
  color: white;
}

/* Botón de eliminación */
.modal-btn-delete {
  background: #d9534f;
  color: white;
}

/* ============================================================
   ESTILOS DE LISTADO DE USOS DE KEYWORDS
============================================================ */
.kw-uso-wrapper {
  margin: 10px 0 0 6px;
}

.kw-uso-block {
  background: #f6f7fb;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  border-left: 3px solid #4175fa;
}

.kw-uso-title {
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 600;
  color: #1e2a48;
}

.kw-uso-details {
  font-size: 13px;
  padding-left: 10px;
  color: #444;
}

.kw-uso-item {
  margin: 2px 0;
}

/* ============================================================
   MODAL ADD ITEM (recursos / actividades)
============================================================ */
.modal-add-category {
  display: inline-block;
  background: #eef2ff;
  color: #3743ab;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.modal-add-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modal-add-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0d4dd;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.modal-add-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 480px) {
  .modal-window {
    width: calc(100vw - 2rem);
    max-height: 85vh;
  }
  .modal-header {
    padding: 14px 16px 8px;
  }
  .modal-body {
    padding: 0 16px 16px;
    max-height: 55vh;
  }
  .modal-buttons {
    padding: 12px 16px 16px;
  }
  .modal-title {
    font-size: 1.15rem;
  }
}