/**
 * Styling for Views Tables
 */

/* Base table styling */
.path-publications table.cols-5 {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem; /* Base smaller font size */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05);
  /* background-color: red; */
}

/* Table header styling */
.path-publications table.cols-5 thead {
  background-color: #f8f9fa;
}

.path-publications table.cols-5 th {
  padding: 0.75rem;
  font-weight: 600;
  text-align: left;
  color: #333;
  border-bottom: 2px solid #dee2e6;
  font-size: 0.75rem; /* Smaller headers */
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Table body styling */
.path-publications table.cols-5 tbody tr {
  transition: background-color 0.15s ease-in-out;
}

.path-publications table.cols-5 tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.path-publications table.cols-5 tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.path-publications table.cols-5 td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
  border-top: 1px solid #dee2e6;
  color: #495057;
}

/* Make title column wrap content */
.path-publications table.cols-5 td.views-field-title {
  max-width: 350px;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}

/* Date styling */
.path-publications table.cols-5 .views-field-created time {
  white-space: nowrap;
  font-size: 0.75rem;
}

/* Links styling */
.path-publications table.cols-5 a {
  color: #0d6efd;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

.path-publications table.cols-5 a:hover {
  color: #0a58ca;
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .path-publications table.cols-5 th,
  .path-publications table.cols-5 td {
    padding: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  /* Convert to card-like display on small screens */
  .path-publications table.cols-5,
  .path-publications table.cols-5 thead,
  .path-publications table.cols-5 tbody,
  .path-publications table.cols-5 th,
  .path-publications table.cols-5 td,
  .path-publications table.cols-5 tr {
    display: block;
  }

  .path-publications table.cols-5 thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .path-publications table.cols-5 tr {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .path-publications table.cols-5 td {
    position: relative;
    padding-left: 40%;
    border: none;
    border-bottom: 1px solid #eee;
    white-space: normal;
    text-align: left;
  }

  .path-publications table.cols-5 td:last-child {
    border-bottom: 0;
  }

  .path-publications table.cols-5 td:before {
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    width: 35%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
    content: attr(headers);
    text-transform: capitalize;
    color: #495057;
  }

  /* Fix the header content issue */
  .path-publications table.cols-5 td[headers="view-field-ar-protokollou-table-column"]:before {
    content: "Αριθμός Πρωτοκόλλου";
  }

  .path-publications table.cols-5 td[headers="view-field-pub-category-table-column"]:before {
    content: "Κατηγορία";
  }

  .path-publications table.cols-5 td[headers="view-field-sheet-number-table-column"]:before {
    content: "Αριθμός Φύλλου";
  }

  .path-publications table.cols-5 td[headers="view-created-table-column"]:before {
    content: "Ημερομηνία";
  }

  /* Make first column full width */
  .path-publications table.cols-5 td.views-field-title {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
    background-color: #f8f9fa;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    max-width: none;
    white-space: normal;
  }

  .path-publications table.cols-5 td.views-field-title:before {
    display: none;
  }
}

/* Dark mode support */
.tw-dark .path-publications table.cols-5 thead {
  background-color: #2b3035;
}

.tw-dark .path-publications table.cols-5 th {
  color: #e6e6e6;
  border-bottom-color: #495057;
}

.tw-dark .path-publications table.cols-5 tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.05);
}

.tw-dark .path-publications table.cols-5 tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.075);
}

.tw-dark .path-publications table.cols-5 td {
  border-top-color: #495057;
  color: #e6e6e6;
}

.tw-dark .path-publications table.cols-5 a {
  color: #6ea8fe;
}

.tw-dark .path-publications table.cols-5 a:hover {
  color: #9ec5fe;
}

.tw-dark .path-publications table.cols-5 tr {
  background-color: #212529;
}

@media (max-width: 767.98px) {
  .tw-dark .path-publications table.cols-5 tr {
    background-color: #212529;
    border-color: #495057;
  }

  .tw-dark .path-publications table.cols-5 td {
    border-bottom-color: #343a40;
  }

  .tw-dark .path-publications table.cols-5 td:before {
    color: #ced4da;
  }

  .tw-dark .path-publications table.cols-5 td.views-field-title {
    color: #f8f9fa;
    background-color: #343a40;
  }
}
