/* Library pages is not responsive - completed- library-rules.php and tablestyles.css */
/* do the cse-student-resources table styles for all the 4 pages . make the table scroll in x axis */
/* side bar- again click should disappear -> Completed - copy only style.css*/

/* Universal Responsive Table Container with Box Shadow */
.table-responsive-container,
.table-responsive-wrapper {
  border: 3px solid #00282a;
  display: flex;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 15px;
  margin-bottom: 30px;
  border-radius: 20px;
  box-shadow:
    rgba(0, 0, 0, 0.25) 0px 14px 28px,
    rgba(0, 0, 0, 0.22) 0px 10px 10px !important;
}

/* Universal Table Base Styling */
.table {
  border-radius: 20px;
  border-collapse: separate;
  border-spacing: 0; /* Zero cell gap */
  width: 100%;
  max-width: 100%;
  height: auto;
  box-shadow: none;
  text-align: center;
  margin: 0 auto;
  background-color: #ffffff;
}

/* Universal Cell Styling */
.trow {
  padding: 16px 12px;
  border: 1px solid #00282a;
  vertical-align: middle;
  text-align: center;
}

.theader {
  font-weight: 600;
  border-bottom: 1.5px solid #00282a;
  font-size: 16px;
  padding: 18px 14px;
  background-color: #f8f9fa;
  text-align: center;
}

.tlinks {
  padding: 6px 4px;
  text-align: center;
}

.tlinks a {
  display: inline-block;
  background: rgb(26, 61, 50);
  color: #ffffff !important;
  padding: 6px 14px;
  border-radius: 12px;
  margin: 3px 4px;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 13px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.tlinks a:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(26, 61, 50, 0.45);
  background: rgb(38, 88, 72);
  color: #ffffff !important;
}

/* 4-Column Specific Table Proportions */
.table.table-4col,
.table-resource {
  table-layout: fixed;
}

.table.table-4col th:nth-child(1),
.table.table-4col td:nth-child(1),
.table-resource th:nth-child(1),
.table-resource td:nth-child(1) {
  width: 8%;
}

.table.table-4col th:nth-child(2),
.table.table-4col td:nth-child(2),
.table-resource th:nth-child(2),
.table-resource td:nth-child(2) {
  width: 18%;
}

.table.table-4col th:nth-child(3),
.table.table-4col td:nth-child(3),
.table-resource th:nth-child(3),
.table-resource td:nth-child(3) {
  width: 44%;
}

.table.table-4col td:nth-child(3),
.table-resource td:nth-child(3) {
  text-align: left;
  padding-left: 20px;
}

.table.table-4col th:nth-child(4),
.table.table-4col td:nth-child(4),
.table-resource th:nth-child(4),
.table-resource td:nth-child(4) {
  width: 30%;
}

/* Universal Mobile View: Horizontal Touch Scroll for ALL Tables */
@media (max-width: 768px) {
  .table-responsive-container,
  .table-responsive-wrapper {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border: 3px solid #00282a;
    border-radius: 20px;
    margin-top: 10px;
    margin-bottom: 20px;
    box-shadow:
      rgba(0, 0, 0, 0.2) 0px 8px 16px,
      rgba(0, 0, 0, 0.18) 0px 4px 6px !important;
  }

  .table {
    border-radius: 14px;
    border-width: 2.5px;
    min-width: 580px; /* Universal min-width so ANY table (2, 3, 4, 5, 6+ columns) scrolls horizontally on mobile */
  }

  .trow {
    padding: 8px 4px !important;
    font-size: 12px !important;
    line-height: 1.25;
    text-align: center;
  }

  .theader {
    font-size: 13px !important;
    padding: 10px 4px !important;
    line-height: 1.25;
    word-break: break-word;
    text-align: center;
  }

  .tlinks a {
    padding: 3px 6px !important;
    font-size: 10px !important;
    margin: 2px 1px !important;
    border-radius: 6px !important;
  }
}

@media (max-width: 480px) {
  .theader {
    font-size: 12px !important;
    padding: 8px 3px !important;
    text-align: center;
  }

  .trow {
    padding: 6px 3px !important;
    font-size: 11px !important;
    text-align: center;
  }

  .tlinks a {
    padding: 2px 5px !important;
    font-size: 9.5px !important;
    margin: 1px !important;
    border-radius: 5px !important;
  }
}
