/* Table Styles for Display Settings, Entries List, and Popups */
#display-settings-container table,
#megaenst-popup table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0px;
  font-family: sans-serif;
  box-sizing: border-box;
}

#display-settings-container th,
#megaenst-popup th {
  background-color: rgb(242, 242, 242);
  border: 1px solid rgb(221, 221, 221);
  padding: 8px;
  text-align: left;
}

#display-settings-container td,
#megaenst-popup td {
  /* the element was td */
  border: 1px solid rgb(221, 221, 221);
  padding: 8px;
  text-align: left;
}

@media (max-width: 600px) {
  #display-settings-container th {
    padding: 4px;
  }

  #display-settings-container td {
    padding: 4px;
  }
}

#display-settings-container tr,
#megaenst-popup tr {
  background-color: rgb(249, 249, 249);
}

/* Search Filter Form Styles */
form#search-filter {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 10px;
  border: 1px solid rgb(221, 221, 221);
  box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
  background-color: rgb(249, 249, 249);
}

#search-filter .form-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 5px;
}

#search-filter label {
  /* the element was label */
  font-weight: bold;
  margin-bottom: 5px;
  color: rgb(51, 51, 51);
}

#search-filter input[type="text"] {
  /* the element was input#from_date */
  border: 1px solid rgb(204, 204, 204);
  border-radius: 4px;
  width: 100%;
}

/* Content container used by plugin popups */
.entries-popup-container {
  max-height: 70vh;
  overflow-y: auto;
}

/* Modern Toggle Switch Styles */
.megaenst-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.megaenst-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.megaenst-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: all 0.3s ease;
}

.megaenst-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.megaenst-toggle-switch input:checked + .megaenst-slider {
  background-color: #4caf50;
}

.megaenst-toggle-switch input:focus + .megaenst-slider {
  box-shadow: 0 0 1px #4caf50;
}

.megaenst-toggle-switch input:checked + .megaenst-slider:before {
  transform: translateX(26px);
}

.megaenst-toggle-switch:hover .megaenst-slider {
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.megaenst-toggle-switch input:disabled + .megaenst-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.megaenst-toggle-switch input:disabled + .megaenst-slider:before {
  cursor: not-allowed;
}

/* Loader Styles */
.megaenst-entries-list-table .loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  /* semi-transparent black */
  justify-content: center;
  align-items: center;
  z-index: 999;
  /* above other content */
}

.megaenst-entries-list-table .loader-icon {
  width: 48px;
  height: 48px;
  border: 5px solid #fff;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/*Sortable CSS*/
#save-display-settings .draggable-setting {
  cursor: move;
  width: 20px;
  text-align: center;
}

@media (max-width: 600px) {
  .form-table,
  .form-table tbody,
  .form-table tr {
    display: block;
  }

  .form-table td,
  .form-table th {
    display: flex;
    /* or block */
    width: 100%;
    /* Additional styling for labels or stacking */
  }
}
