/**
 * Chain Selector Styles
 * 검색 가능한 체인 선택 드롭다운 + 서비스 배지
 */

/* =============================================
   체인 선택 버튼
   ============================================= */
.chain-selector-wrapper {
    position: relative;
}

#chainSelector {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    padding: 8px 12px;
    background: var(--theme-dropdown-bg, #fff);
    border: 1px solid var(--theme-border, #ddd);
    color: var(--theme-text, #333);
    transition: all 0.3s ease;
}

#chainSelector:hover {
    background: var(--theme-hover-bg, #f8f9fa);
    border-color: var(--theme-hover-border, #ccc);
}

.chain-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.chain-selected {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

/* =============================================
   드롭다운 메뉴
   ============================================= */
.chain-dropdown-menu {
    min-width: 750px !important;
    max-width: 850px !important;
    width: 750px !important;
    padding: 0 !important;
    margin-top: 4px;
    background: var(--theme-dropdown-bg, #fff) !important;
    border: 1px solid var(--theme-border, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideDown 0.2s ease-out !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chain-dropdown-menu {
        min-width: 320px !important;
        max-width: calc(100vw - 40px) !important;
    }
}

/* =============================================
   검색 입력
   ============================================= */
.chain-search-wrapper {
    position: relative;
    padding: 12px;
    border-bottom: 1px solid var(--theme-border, #eee);
    background: var(--theme-dropdown-bg, #fff) !important;
}

.chain-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px !important;
    border: 1px solid var(--theme-border, #ddd);
    border-radius: 6px;
    background: var(--theme-input-bg, #f8f9fa);
    color: var(--theme-text, #333);
    font-size: 14px;
    transition: all 0.3s ease;
}

.chain-search-input:focus {
    outline: none;
    border-color: #48ABF7;
    background: var(--theme-input-bg, #1a1a1a) !important;
    box-shadow: 0 0 0 3px rgba(72, 171, 247, 0.1);
}

.chain-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-muted, #999);
    font-size: 14px;
    pointer-events: none;
}

/* =============================================
   서비스 필터 버튼
   ============================================= */
#chainServiceFilters {
    padding: 8px 12px 12px 12px;
    border-bottom: 1px solid var(--theme-border, #eee);
    background: var(--theme-dropdown-bg, #fff);
}

.service-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.service-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--theme-input-bg, #f8f9fa);
    border: 1.5px solid var(--theme-border, #ddd);
    border-radius: 6px;
    color: var(--theme-text, #333);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.service-filter-btn i {
    font-size: 12px;
    color: var(--service-color, var(--theme-text, #333));
}

.service-filter-btn .filter-name {
    font-weight: 600;
}

.service-filter-btn .filter-count {
    padding: 2px 6px;
    background: var(--theme-dropdown-bg, #fff);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--theme-muted, #999);
}

.service-filter-btn:hover {
    background: var(--theme-hover-bg, #e9ecef);
    border-color: var(--service-color, #48ABF7);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.service-filter-btn:hover i {
    color: var(--service-color, #48ABF7);
}

.service-filter-btn.active {
    background: var(--service-color, #48ABF7);
    border-color: var(--service-color, #48ABF7);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.service-filter-btn.active i {
    color: #fff;
}

.service-filter-btn.active .filter-name {
    color: #fff;
}

.service-filter-btn.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #chainServiceFilters {
        padding: 6px 8px 8px 8px;
    }

    .service-filter-buttons {
        gap: 6px;
    }

    .service-filter-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .service-filter-btn i {
        font-size: 11px;
    }

    .service-filter-btn .filter-count {
        font-size: 10px;
        padding: 1px 5px;
    }
}

/* =============================================
   체인 목록 스크롤 영역
   ============================================= */
.chain-list-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.chain-list {
    padding: 8px 0;
}

/* =============================================
   체인 카테고리 헤더
   ============================================= */
.chain-category-header {
    padding: 12px 16px 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--theme-text-muted, #999);
    letter-spacing: 0.5px;
    background: var(--theme-section-bg, transparent);
    border-bottom: 0.5px solid var(--theme-border, #f0f0f0);
    margin-top: 8px;
}

.chain-category-header:first-child {
    margin-top: 0;
}

/* =============================================
   체인 아이템
   ============================================= */
.chain-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    background: var(--theme-dropdown-bg, #fff);
    color: var(--theme-dropdown-text, #333);
}

.chain-item:hover {
    background: var(--theme-hover-bg, #f8f9fa) !important;
    color: var(--theme-hover-text, #333) !important;
    border-left-color: #48ABF7 !important;
}

.chain-item.active {
    background: var(--theme-active-bg, rgba(72, 171, 247, 0.1)) !important;
    color: var(--theme-active-color, #4d7cfe) !important;
    border-left-color: #48ABF7 !important;
    font-weight: 500;
}

.chain-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.chain-item-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.chain-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.chain-item-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--theme-dropdown-text, #333);
}

.chain-item-id {
    font-size: 11px;
    color: var(--theme-muted, #999);
    font-family: 'Courier New', monospace;
}

.chain-item-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 12px;
}

/* =============================================
   서비스 배지
   ============================================= */
.service-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* Meta Service - Blue */
.service-badge.service-meta {
    background: rgba(72, 171, 247, 0.15);
    color: #48ABF7;
    border: 1px solid rgba(72, 171, 247, 0.3);
}

.chain-item:hover .service-badge.service-meta {
    background: rgba(72, 171, 247, 0.25);
}

/* Qlue Service - Green */
.service-badge.service-qlue {
    background: rgba(49, 206, 54, 0.15);
    color: #31CE36;
    border: 1px solid rgba(49, 206, 54, 0.3);
}

.chain-item:hover .service-badge.service-qlue {
    background: rgba(49, 206, 54, 0.25);
}

/* Mist Service - Purple */
.service-badge.service-mist {
    background: rgba(104, 97, 206, 0.15);
    color: #6861CE;
    border: 1px solid rgba(104, 97, 206, 0.3);
}

.chain-item:hover .service-badge.service-mist {
    background: rgba(104, 97, 206, 0.25);
}

/* =============================================
   Empty State
   ============================================= */
.chain-empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--theme-muted, #999);
}

.chain-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.chain-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* =============================================
   Dark Theme Support
   ============================================= */
/* Removed: colors.css theme variables handle all theme styling automatically */

/* =============================================
   Scrollbar Styling (체인 목록용)
   ============================================= */
/* Removed: Global scrollbar styles in main.css or data-persistence.css handle this */

/* =============================================
   검색 결과 하이라이트
   ============================================= */
.chain-item .highlight {
    background: rgba(255, 237, 74, 0.4);
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}
