/* File: css/language-database.css */
/* Style untuk halaman database bahasa */

/* ==========================================================================
   1. UTILITIES & GENERAL
   ========================================================================== */
.cursor-pointer { 
    cursor: pointer !important; 
}

/* ==========================================================================
   2. TABLE CONTAINER & LAYOUT
   ========================================================================== */
#table-container {
    max-height: 65vh; /* Sesuaikan angka ini (misal: 600px atau 75vh) */
    min-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    position: relative;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

/* Tabel Border & Spacing */
#table-container table {
    border-collapse: separate !important; 
    border-spacing: 0;
    width: max-content;
}

#table-container th, 
#table-container td {
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 0.75rem; /* Padding lebih lega */
    vertical-align: middle;
}

/* Cell Wrapping Limits */
#table-container td {
    white-space: normal !important; 
    word-wrap: break-word;
    max-width: 800px;
    min-width: 120px; 
}

/* ==========================================================================
   3. STICKY HEADERS & COLUMNS
   ========================================================================== */
/* Sticky Header */
#table-container thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Sticky Columns (Kolom 1 & 2) */
#table-container table tr > *:nth-child(1),
#table-container table tr > *:nth-child(2) {
    position: sticky;
    background-color: #fff;
    z-index: 5;
}

/* Sticky Header pada Sticky Column (Pertemuan Pojok Kiri Atas) */
#table-container thead th:nth-child(1),
#table-container thead th:nth-child(2) {
    z-index: 20; 
    background-color: #f8f9fa;
}

/* Posisi & Lebar Kolom 1 (ID) */
#table-container table tr > *:nth-child(1) {
    left: 0;
    width: 60px;
    min-width: 60px;
    border-right: 1px solid #dee2e6; 
    text-align: center;
}

/* Posisi & Lebar Kolom 2 (Name) */
#table-container table tr > *:nth-child(2) {
    left: 60px;
    width: 250px;
    min-width: 200px;
    border-right: 2px solid #343a40 !important; /* Batas lebih gelap sedikit */
}

/* ==========================================================================
   4. INTERAKSI & EDITABLE CELLS
   ========================================================================== */
/* Warna Background Hover Baris */
#table-container tbody tr:hover > * {
    background-color: #f1f3f5; /* Abu-abu sangat muda */
}

/* Pastikan sticky column ikut berubah warna saat hover */
#table-container tbody tr:hover > *:nth-child(1),
#table-container tbody tr:hover > *:nth-child(2) {
    background-color: #f1f3f5; 
}

/* Warna Row saat diedit (Warning) */
#table-container tbody tr.table-warning > *:nth-child(1),
#table-container tbody tr.table-warning > *:nth-child(2) {
    background-color: #fff3cd;
}

/* Editable Input Styling */
.editable-cell { cursor: pointer; transition: background 0.2s; }
.editable-cell:hover { background-color: #fff3cd !important; }
.editable-cell.editing { padding: 0; }
.editable-cell input { 
    border-radius: 0; height: 100%; width: 100%; border: none; padding: 0.75rem;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1); 
    background-color: #fffbe6;
}

/* ==========================================================================
   5. INDIKATOR STATUS
   ========================================================================== */
#unsaved-indicator {
    /* Warna Merah & Teks Putih */
    background-color: #dc3545; 
    color: white;

    /* Ukuran & Spacing */
    font-size: 0.9em;
    padding: 8px 12px;
    
    /* Default State (Sembunyi) */
    display: none; 
}

/* ==========================================================================
   6. STYLING TOMBOL FILTER & DROPDOWN (MENIRU SCRIPTURE DATABASE)
   Target: .filter-dropdown (untuk Region/Language) & .column-chooser-dropdown
   ========================================================================== */

/* 1. CONTAINER DROPDOWN MENU */
/* Menargetkan dropdown pada halaman Language Database */
#columnChooserList, 
#regionFilterList, 
#languageFilterList,
.column-chooser-dropdown .dropdown-menu {
    z-index: 2000 !important;
    min-width: 260px;          /* Lebar sedikit lebih lega */
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: #212529;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.5rem;     /* Sudut lebih membulat */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 2. ITEM LIST (WRAPPER) */
/* Menargetkan element <li> atau <label> di dalam dropdown */
#columnChooserList .dropdown-item,
#regionFilterList .dropdown-item,
#languageFilterList .dropdown-item,
.column-chooser-dropdown .form-check {
    display: flex !important;    /* KUNCI: Agar checkbox dan teks sejajar rapi */
    align-items: center;
    width: 100%;
    padding: 0.35rem 1.25rem;    /* Spacing nyaman */
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    white-space: normal;         /* Izinkan teks turun baris jika panjang */
    background-color: transparent;
    border: 0;
    cursor: pointer;             
    margin-bottom: 0;
    text-decoration: none;
}

/* 3. EFEK HOVER (HIGHLIGHT) */
#columnChooserList .dropdown-item:hover,
#regionFilterList .dropdown-item:hover,
#languageFilterList .dropdown-item:hover,
.column-chooser-dropdown .form-check:hover {
    color: #1e2125;
    background-color: #f1f3f5; /* Abu-abu muda terang (Sama seperti Scripture) */
}

/* 4. CHECKBOX INPUT */
/* Reset posisi checkbox agar rapi */
#columnChooserList input[type="checkbox"],
#regionFilterList input[type="checkbox"],
#languageFilterList input[type="checkbox"],
.column-chooser-dropdown .form-check-input {
    position: static !important;
    float: none !important;
    margin-top: 0 !important;
    margin-right: 12px;         /* Jarak checkbox ke teks */
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0; 
    cursor: pointer;
    border-color: #adb5bd;
    border-radius: 0.25em;
}

/* Warna saat dicentang (Biru OSD) */
input[type="checkbox"]:checked,
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 5. STICKY HEADER SEARCH (Untuk Input Pencarian di dalam Dropdown) */
/* Pastikan header pencarian tidak ikut ter-scroll */
#columnChooserList .sticky-top,
#regionFilterList .sticky-top,
#languageFilterList .sticky-top {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem;
}

/* Input Search Styling */
.dropdown-search-input {
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.9rem;
    width: 100%;
    border: 1px solid #ced4da;
}