/* css/table.css */

table {
  width: 100%;
  table-layout: fixed;      
  border-collapse: collapse;
  border-spacing: 0;        
  margin-top: 1px;
  background: var(--input-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px var(--shadow-light);
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 2px 10px;
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}

th {
  background-color: var(--input-bg);
  color: var(--fg);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }

tr:last-child td {
  border-bottom: none;
}


/* --- Pagination Styles --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.pagination-controls button {
    padding: 8px 15px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    flex-shrink: 0; /* Prevent buttons from shrinking */
    width: auto; /* Allow button to size based on content */
    margin: 0; /* Override previous margin */
    box-shadow: 0 1px 3px var(--shadow-light);
}

.pagination-controls button:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.pagination-controls button:disabled {
    background-color: var(--border);
    cursor: not-allowed;
    opacity: 0.7;
}

.pagination-pages {
    display: flex;
    gap: 5px;
}

.pagination-page-number {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background-color: var(--input-bg);
    color: var(--fg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px var(--shadow-light);
}

.pagination-page-number:hover {
    background-color: var(--border);
    color: var(--accent-hover);
}

.pagination-page-number.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: bold;
    box-shadow: 0 2px 5px var(--shadow-medium);
}
.pagination-ellipsis {
    padding: 8px 0;
    color: var(--fg);
    font-weight: bold;
}

/* Container untuk tabel dengan scroll */
.table-container {
    height: 56.5vh;
    min-height: 200px;
    max-height: 85vh; /* MENGATUR UKURAN PANJANG TABLE */
    overflow-y: auto; /* TETAP MEMPERTANAHANKAN SCROLL INTERNAL */
    border: 1px solid var(--border-color); /* Opsional: tambahkan border */
    border-radius: 8px; /* Opsional: tambahkan sudut membulat */
    scrollbar-width: none; /* Untuk Firefox */
    resize: vertical; /* <-- TAMBAHKAN BARIS INI */
}

/* Untuk menyembunyikan scrollbar di browser Webkit */
.table-container::-webkit-scrollbar {
  display: none;
}

/* Opsional: Untuk menjaga header tabel tetap terlihat saat scroll */
.table-container table thead th {
    position: sticky;
    top: 0;
    background-color: var(--background-color); /* Sesuaikan dengan warna background tabel Anda */
    z-index: 10;
}

/* Asumsi kolom "Data Core" adalah kolom ke-4 */
/* mengatur lebar no */
.table-container table th:nth-child(1),
.table-container table td:nth-child(1) {
    width: 20px;
    text-align: center;
}

/* mengatur lebar segmentasi */
.table-container table th:nth-child(2),
.table-container table td:nth-child(2) {
    width: 150px;
    text-align: center;
    padding-left: 15px;
}

/* mengatur lebar cluster */
.table-container table th:nth-child(3),
.table-container table td:nth-child(3) {
    width: 50px;
    text-align: center;
}

/* mengatur lebar no jaringan 1 */
.table-container table th:nth-child(4),
.table-container table td:nth-child(4) {
    width: 170px;
    text-align: center;
}

/* mengatur lebar no jaringan 2 */
.table-container table th:nth-child(5),
.table-container table td:nth-child(5) {
    width: 170px;
    text-align: center;
}

/* mengatur lebar Data Core */
.table-container table th:nth-child(6),
.table-container table td:nth-child(6) {
    width: 60px;
    text-align: center;
    padding-left: 15px;
}

/* mengatur lebar Tanggal Diubah */
.table-container table th:nth-child(7),
.table-container table td:nth-child(7) {
    width: 80px;
    text-align: center;
}

/* mengatur lebar Perubahan Oleh */
.table-container table th:nth-child(8),
.table-container table td:nth-child(8) {
    width: 80px;
    text-align: center;
}

/* mengatur lebar Jenis Jaringan */
.table-container table th:nth-child(9),
.table-container table td:nth-child(9) {
    width: 70px;
    text-align: center;
}

/* mengatur lebar Aksi */
.table-container table th:nth-child(10),
.table-container table td:nth-child(10) {
    width: 90px;
    text-align: center;
}

