/* Web File: /styles/cwr-list-framework.css */

/* ---------- Body / Basics ---------- */
body {
  font-family: "Roboto", sans-serif;
  color: #333;
}

/* ---------- Toolbar ---------- */
.tm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.row-container {
  min-height: 200px;
}

/* ---------- TABLE ---------- */
.tm-table {
  width: 100%;
}

.tm-table th:nth-child(1),
.tm-table td:nth-child(1) {
  width: 1%;
}

.tm-table th:nth-child(2),
.tm-table td:nth-child(2) {
  width: 25%;
}

.tm-table th:nth-child(3),
.tm-table td:nth-child(3) {
  width: 35%;
}

.tm-table th:nth-child(4),
.tm-table td:nth-child(4),
.tm-table th:nth-child(5),
.tm-table td:nth-child(5) {
  width: 15%;
}

.tm-table thead th {
  color: var(--bs-secondary-color) !important;
  font-weight: 600;
  border-bottom: 1px solid #e5e5e5;
  border-top: 1px solid #e5e5e5;
  padding: 8px 12px;
}

.tm-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.tm-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* ---------- LIST VIEW ---------- */
.tm-list table {
  border-collapse: separate;
  border-spacing: 0 6px;
  width: 100%;
}

.tm-list .sp-row {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
}

.tm-list th {
  color: #6c757d;
  font-weight: 600;
}

.tm-list td {
  vertical-align: middle;
}

.tm-name {
  font-weight: 500;
  cursor: pointer;
}

.tm-desc {
  color: #6c757d;
  font-size: 0.9rem;
}

.fitwidth {
  width: 48px;
}

/* ---------- CARD GRID VIEW ---------- */
.tm-card-grid .tm-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.75rem;
  background-color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.tm-card-grid .tm-thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.tm-card-grid .tm-icon i {
  opacity: 0.9;
}

.tm-card .fw-semibold {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-card .xsmall {
  font-size: 0.75rem;
  color: #6c757d;
}

/* ---------- FILE ICON COLORS ---------- */
.tm-icon {
  font-size: 1.2rem;
  cursor: pointer;
}

.tm-icon-cardview {
  font-size: 2rem;
}

.bi-file-earmark-pdf {
  color: #dc3545 !important;
}

.bi-file-earmark-play {
  color: #0d6efd !important;
}

.bi-file-earmark-word {
  color: #0a58ca !important;
}

.bi-file-earmark-excel {
  color: #198754 !important;
}

.bi-file-earmark-image {
  color: #ffc107 !important;
}

.bi-file-earmark-ppt {
  color: #fd7e14 !important;
}

.bi-file-earmark-zip {
  color: #6c757d !important;
}

.bi-file-earmark {
  color: #adb5bd !important;
}

/* ---------- PAGINATION ---------- */
.pagination-container {
  z-index: 1040;
}

.pagination-btn {
  min-width: 90px;
}

.page-info {
  min-width: 100px;
  text-align: center;
}

@media (max-width: 576px) {
  .pagination-container .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .items-per-page {
    justify-content: center;
  }
}

/* --- Responsive Layout Fixes --- */
@media (max-width: 768px) {
  #categoryFilter,
  #subcategoryFilter,
  label[for="categoryFilter"],
  label[for="subcategoryFilter"],
  #applyFilter,
  #clearFilter {
    display: none !important;
  }

  .tm-table th:nth-child(4),
  .tm-table th:nth-child(5),
  .tm-table td:nth-child(4),
  .tm-table td:nth-child(5) {
    display: none !important;
  }

  .tm-card {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .tm-thumb {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .row.gx-3.gy-2 {
    margin: 0;
  }

  #search-form {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* --- Theme --- */

/* Body & Basic Styling, applies to table only */
body {
  flex-direction: column;
  height: 100vh;
  font-family: "Roboto", sans-serif;
  color: #333;
}

/* Sigma Deep Purple Button Color */
.btn-sigma {
  background-color: #45237c; /* Sigma purple */
  border-color: #45237c;
  color: #fff;
  transition: all 0.3s ease;
}
.btn-sigma:hover {
  background-color: #3a1f6a;
  border-color: #3a1f6a;
  color: #fff;
}
.btn-outline-sigma {
  color: #45237c;
  border-color: #45237c;
  transition: all 0.3s ease;
}
.btn-outline-sigma:hover {
  background-color: #45237c;
  color: #fff;
}
.btn-outline-secondary {
  color: #6c757d;
  border-color: #d0d4d8;
  background-color: #fff;
}
.btn-outline-secondary:hover {
  background-color: #f8f9fa;
  border-color: #bfc5cb;
}
