/* ========================================================
 * 공통 자동완성 드롭다운 (ui_autocomplete.js 전용)
 * ======================================================== */

.ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 4px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #d0d6dd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* 5건 정도만 보이고 나머지는 내부 스크롤 (item 약 41px × 5 + padding 8px) */
    max-height: 213px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
}

/* 스크롤바 스타일 (webkit) */
.ac-dropdown::-webkit-scrollbar {
    width: 8px;
}
.ac-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.ac-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.ac-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.ac-dropdown.is-open {
    display: block;
}

.ac-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
    color: #1f2937;
    transition: background-color 0.1s ease;
}

.ac-item.is-active,
.ac-item:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.ac-item .ac-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-item .ac-label strong {
    color: #1d4ed8;
    font-weight: 700;
}

.ac-item .ac-sub {
    flex: 0 0 auto;
    color: #6b7280;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50%;
}

/* 인물 검색바 등 form-keyword 컨테이너 안에서 input이 wrapper 역할
   form-keyword가 position:relative 보장되도록 JS에서 처리 */
.form-keyword .ac-dropdown {
    /* 검색바 안 select(분류)+input 전체 너비에 맞춤 */
    left: 0;
    right: 0;
}

/* 모바일 */
@media (max-width: 768px) {
    .ac-dropdown {
        max-height: 233px; /* 모바일 item 약 45px × 5 + padding 8px */
    }
    .ac-item {
        padding: 12px 14px;
        font-size: 14px;
    }
    .ac-item .ac-sub {
        font-size: 12px;
    }
}
