/**
 * country-select.css — 國際版可搜尋國家/地區選擇器樣式
 * 搭配 Web/public/js/country-select.js 使用。
 */

.country-select {
    position: relative;
    width: 100%;
}

.country-select-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.country-select-trigger .cs-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-select-trigger .fi {
    flex: 0 0 auto;
    width: 1.33em;
    line-height: 1em;
    border-radius: 2px;
}

.country-select-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1060;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #ced4da);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.country-select-search {
    width: calc(100% - 1rem);
    margin: 0.5rem;
}

.country-select-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.25rem;
    max-height: 260px;
    overflow-y: auto;
}

.country-select-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.country-select-item .cs-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-select-item .cs-dial {
    flex: 0 0 auto;
    color: var(--bs-secondary-color, #6c757d);
    font-variant-numeric: tabular-nums;
    font-size: 0.85em;
}

.country-select-item .fi {
    flex: 0 0 auto;
    width: 1.33em;
    border-radius: 2px;
}

.country-select-item:hover,
.country-select-item.is-selected {
    background: var(--bs-tertiary-bg, #f1f3f5);
}

.country-select-item.is-selected {
    font-weight: 600;
}

/* 暗黑模式覆寫 */
[data-theme="dark"] .country-select-panel {
    background: var(--bs-body-bg, #1e1e24);
    border-color: var(--bs-border-color, #3a3a44);
}

[data-theme="dark"] .country-select-item:hover,
[data-theme="dark"] .country-select-item.is-selected {
    background: rgba(255, 255, 255, 0.07);
}
