﻿.combobox-container {
    font-family: 'Inter', sans-serif;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.combobox-label {
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
}

.combobox-wrapper {
    position: relative;
}

.combobox-input {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 16px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}
    .combobox-input.readonly {
        background: #fafafa;
        opacity: 0.8;
    }

    .combobox-input:hover {
        border-color: #9ca3af;
    }

    .combobox-input:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    }

.combobox-selected-text {
    color: #111827;
    font-size: 15px;
}

    .combobox-selected-text.placeholder {
        color: #9ca3af;
    }

.combobox-arrow {
    color: #9ca3af;
    transition: transform 0.2s;
}

    .combobox-arrow.open {
        transform: rotate(180deg);
    }

/* Dropdown Styles */
.combobox-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
    overflow: hidden;
}

.combobox-dropdown.open-up {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
}

.combobox-list {
    max-height: 240px;
    overflow-y: auto;
}

.combobox-item {
    padding: 12px 16px;
    color: #374151;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 1px solid #f9fafb;
}

    .combobox-item:hover {
        background-color: #f3f4f6;
    }

/* Footer Action */
.combobox-footer {
    padding: 8px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 8px;
}

a.btn-add-new {
    flex: 1;
    padding: 10px;
    background-color: #eff6ff;
    color: #2563eb;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    text-align: center;
    display: block;
}

    a.btn-add-new:hover {
        background-color: #dbeafe;
    }

button.btn-quick-new {
    flex: 1;
    padding: 10px;
    background-color: #f0fdf4;
    color: #16a34a;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

    button.btn-quick-new:hover {
        background-color: #dcfce7;
    }

/* Container untuk input search agar ada jarak */
.combobox-search-wrapper {
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.combobox-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box; /* Agar padding tidak merusak lebar */
}

    .combobox-search-input:focus {
        border-color: #3b82f6;
        ring: 2px solid #dbeafe;
    }

/* Memastikan list tidak tertutup saat discroll jika data sangat banyak */
.combobox-list {
    max-height: 250px; /* Pastikan ada tingginya */
    overflow-y: auto; /* Supaya bisa scroll kalau datanya banyak */
    min-height: 20px; /* Mencegah collapse jadi 0px */
    background: white;
}

/* Layout Multi Kolom */
.combobox-header-row {
    display: flex;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 4px;
}

.combobox-item.multi-column {
    display: flex;
    padding: 0 4px;
    border-bottom: 1px solid #f3f4f6;
}

.cc-column-cell {
    padding: 10px 12px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-right: 1px solid #f3f4f6;
}

    .cc-column-cell.header {
        font-weight: 600;
        color: #4b5563;
        font-size: 12px;
        text-transform: uppercase;
    }

    .cc-column-cell:last-child {
        border-right: none;
        flex-grow: 1; /* Kolom terakhir mengambil sisa ruang */
    }

/* Item list menumpuk ke bawah (Bukan ke samping) */
.combobox-item.vertical-stack {
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
}

    .combobox-item.vertical-stack:hover {
        background-color: #fafafa;
    }

/* Baris 1: Font 12px Medium, Gray 500 */
.cc-row-cell.top-line {
    font-size: 12px;
    font-weight: 500;
    color: #737373; /* Gray 500 */
}

/* Baris 2 (Main): Font 14px Medium, Black */
.cc-row-cell.main-line {
    font-size: 14px;
    font-weight: 500;
    color: #414651; /* Black */
}

/* Baris 3 (Date): Font 12px Regular, Gray 500 */
.cc-row-cell.date-line {
    font-size: 12px;
    font-weight: 400; /* Regular */
    color: #737373; /* Gray 500 */
}

.cc-row-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 11px;
    border-bottom: 1px solid #e5e7eb;
}

/* Mengatur posisi ikon secara absolut */
.search-input-icon {
    position: absolute;
    left: 17px; /* 11px padding + sedikit jarak tambahan agar tidak nempel border */
    background-color: #9ca3af;
    pointer-events: none;
}

/* Sesuaikan input agar teks tidak menabrak ikon */
.combobox-search-input {
    width: 100%;
    padding: 8px 12px 8px 32px; /* Padding kiri (36px) memberi ruang untuk ikon */
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px; /* Border radius sedikit lebih melengkung sesuai gambar */
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

    .combobox-search-input:focus {
        border-color: #3b82f6;
    }
