/* Base style for any target container */
.loading {
  position: relative;
  pointer-events: none; /* Optional: prevent interaction while loading */
  margin-bottom: 20px;
}

/* The overlay that appears on top */
.loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  opacity: 0.9;
  z-index: 10;
}

/* Progress bar track */
.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  transform: translateY(-50%);
  z-index: 11;
}

.loading::after {
  /* Internal animated stripe using background image */
  background-image: linear-gradient(
    90deg,
    rgba(153, 153, 153, 0.7) 25%,
    transparent 25%,
    transparent 50%,
    rgba(153, 153, 153, 0.7) 50%,
    rgba(153, 153, 153, 0.7) 75%,
    transparent 75%,
    transparent
  );
  background-size: 200% 100%;
  animation: progress-bar-move 1.2s linear infinite;
}

/* Animation keyframes */
@keyframes progress-bar-move {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/**********************************************
*  DataTable Design
**********************************************/

/* Layout: Place buttons and search on the same row */
div.dataTables_wrapper .dt-buttons {
  float: left;
  margin-bottom: 10px;
}

div.dataTables_wrapper .dataTables_filter {
  float: right;
  text-align: right;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
  div.dataTables_wrapper .dt-buttons {
    /* display: flex; */
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    float: none;
  }

  div.dataTables_wrapper .dataTables_filter {
    float: none;
    text-align: center;
    margin-top: 10px;
  }

  .full-label, .r-text {
    display: none !important;
  }

  .icon-only {
    display: inline-block !important;
    font-size: 18px;
  }

  .dt-button {
    padding: 6px 8px;
    min-width: 32px;
  }

  .page-content,
  .page-container {
    padding: 0px;
  }
}
/* Hide button labels, show only icons */

/* On desktop: show labels, hide icons */
@media (min-width: 769px) {
  .icon-only {
    display: none !important;
  }

  .full-label {
    display: inline !important;
  }

  .dt-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  /* These should share width in a row (half width each) */
  .dt-buttons,
  .dt-length,
  .dt-search,
  .dt-paging {
    /* flex: 1 1 48%; */
    flex: 1 0 auto;
    box-sizing: border-box;
  }

  .dt-search,
  .dt-paging,
  .dt-paging .pagination {
    justify-content: end;
  }

  /* These should take full width */
  .dt-scroll,
  .dt-info {
    /* flex: 1 1 100%; */
    width: 100%;
    overflow-x: auto; /* Allow horizontal scroll on small screens */
    -webkit-overflow-scrolling: touch; /* Smooth scroll on mobile */
    box-sizing: border-box;
  }
}

.buttons-colvis {
  padding: 11px;
}
