/**
 * COUNTRY SELECTOR — Searchable Dropdown
 * Adapted from Hunter (lead-hunter) for Novatek Dealer Hunter
 * Colors: Novatek Electric Blue #1E88E5 (replaces Hunter orange #f97316)
 */

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

.country-selector__input {
    width: 100%;
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
    color: var(--text) !important;
    font-size: 0.875rem !important;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    cursor: pointer;
}

.country-selector__input:focus {
    outline: none !important;
    border-color: #1E88E5 !important;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.15) !important;
}

.country-selector__input::placeholder {
    color: var(--text-dim);
}

.country-selector__icon {
    display: none;
}

.country-selector__clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
}

.country-selector__clear:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

.country-selector__clear.visible {
    display: flex;
}

.country-selector__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.country-selector__dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: csDropdownIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes csDropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.country-selector__dropdown::-webkit-scrollbar { width: 4px; }
.country-selector__dropdown::-webkit-scrollbar-track { background: transparent; }
.country-selector__dropdown::-webkit-scrollbar-thumb {
    background: #1E88E5;
    border-radius: 2px;
}
.country-selector__dropdown::-webkit-scrollbar-thumb:hover {
    background: #1565C0;
}

.country-selector__list {
    list-style: none;
    margin: 0;
    padding: 4px;
}

.country-selector__item {
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s ease;
    color: var(--text-dim);
    font-size: 0.8rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
}

.country-selector__item:hover {
    background: rgba(30, 136, 229, 0.12) !important;
    color: var(--text);
}

.country-selector__item.active {
    background: rgba(30, 136, 229, 0.2) !important;
    color: var(--text);
}

.country-selector__item.selected {
    background: rgba(30, 136, 229, 0.15) !important;
    color: #42A5F5;
}

.country-selector__code {
    display: inline-block;
    background: rgba(30, 136, 229, 0.15);
    color: #42A5F5;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    font-family: 'Space Grotesk', monospace;
    letter-spacing: 0.3px;
    min-width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.country-selector__empty,
.country-selector__loading {
    padding: 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}

.country-selector__input:focus-visible {
    outline: 2px solid #1E88E5;
    outline-offset: 2px;
}

.country-selector__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.country-selector__highlight {
    background: rgba(30, 136, 229, 0.2);
    color: #42A5F5;
    font-weight: 600;
    padding: 0 1px;
    border-radius: 2px;
}

/* Container label */
.country-filter-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.country-filter-wrap .filter-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #42A5F5;
}
