/**
 * ╔═══════════════════════════════════════════════════════════╗
 * ║  COUNTRY SELECTOR - Searchable Dropdown Component        ║
 * ║  Compact Dark Theme - Matches Dashboard Style            ║
 * ╚═══════════════════════════════════════════════════════════╝
 */

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

/* Input Field */
.country-selector__input {
    width: 100%;
    background: #27272a !important;
    border: 1px solid #3f3f46 !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
    color: #ffffff !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
}

.country-selector__input:focus {
    outline: none !important;
    border-color: #f97316 !important;
    box-shadow: none !important;
}

.country-selector__input::placeholder {
    color: #6b7280;
}

/* Icon - Hidden */
.country-selector__icon {
    display: none;
}

/* Clear Button */
.country-selector__clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #9ca3af;
    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: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

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

/* Dropdown - Very Compact */
.country-selector__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #27272a !important;
    border: 1px solid #3f3f46 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    max-height: 160px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    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;
}

/* Dropdown Scrollbar - Thin */
.country-selector__dropdown::-webkit-scrollbar {
    width: 4px;
}

.country-selector__dropdown::-webkit-scrollbar-track {
    background: #27272a;
    border-radius: 0 6px 6px 0;
}

.country-selector__dropdown::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 2px;
}

.country-selector__dropdown::-webkit-scrollbar-thumb:hover {
    background: #ea580c;
}

/* Dropdown List - Compact Padding */
.country-selector__list {
    list-style: none;
    margin: 0;
    padding: 4px;
}

/* Dropdown Item - Very Compact */
.country-selector__item {
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.1s ease;
    color: #d4d4d8;
    font-size: 0.75rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
}

.country-selector__item:hover {
    background: rgba(249, 115, 22, 0.15) !important;
    color: #ffffff;
}

.country-selector__item.active {
    background: rgba(249, 115, 22, 0.25) !important;
    color: #ffffff;
    font-weight: 500;
}

.country-selector__item.selected {
    background: rgba(249, 115, 22, 0.2) !important;
    color: #fb923c;
}

/* Country Code Badge - Very Small */
.country-selector__code {
    display: inline-block;
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.2px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Empty State */
.country-selector__empty {
    padding: 12px;
    text-align: center;
    color: #71717a;
    font-size: 12px;
}

/* Loading State */
.country-selector__loading {
    padding: 12px;
    text-align: center;
    color: #71717a;
    font-size: 12px;
}

/* Focus Visible (Accessibility) */
.country-selector__input:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Disabled State */
.country-selector__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #18181b;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .country-selector__dropdown {
        max-height: 180px;
    }

    .country-selector__item {
        padding: 8px 10px;
        font-size: 0.875rem;
    }
}

/* Animation for Dropdown */
@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.country-selector__dropdown.open {
    animation: dropdownSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Highlight Matching Text */
.country-selector__highlight {
    background: rgba(249, 115, 22, 0.25);
    color: #fb923c;
    font-weight: 600;
    padding: 0px 1px;
    border-radius: 2px;
}
