/* Base modal */
.modal {
  display: none; 
  position: fixed; 
  z-index: 9999; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.7); 
  text-align: center;
  padding: 10px; /* added padding for small devices */
}

/* Modal content */
.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px 40px;
  border-radius: 12px;
  width: 90%;
  max-width: 650px;
  position: relative;
  text-align: left;
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  box-sizing: border-box;
}

/* Close button */
.modal .close {
  color: #333;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

html[dir="rtl"] .modal .close {
  right: auto;
  left: 20px;
}

/* Headings */
.modal h3, .modal h4 {
  margin-top: 20px;
  color: #1a253e;
}

/* List */
.modal ul {
  list-style-type: disc;
  padding-left: 20px;
}

html[dir="rtl"] .modal ul {
  padding-left: 0;
  padding-right: 20px;
}

/* Paragraphs */
.modal p {
  font-size: 16px;
  margin: 10px 0;
  color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-content {
    padding: 20px 25px;
    width: 95%;
    font-size: 15px;
  }

  .modal h3, .modal h4 {
    font-size: 18px;
  }

  .modal .close {
    font-size: 24px;
    top: 10px;
    right: 15px;
  }

  html[dir="rtl"] .modal .close {
    left: 15px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 15px 20px;
    width: 98%;
    font-size: 14px;
  }

  .modal h3 {
    font-size: 16px;
  }

  .modal h4 {
    font-size: 15px;
  }

  .modal p {
    font-size: 14px;
  }
}
