/* Country Live Search Styles with Bootstrap Classes and Dark Mode Support */
.country-search-container {
    position: relative;
}

.country-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

/* Bootstrap classes for dropdown styling */
.country-search-dropdown {
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-top: none;
    border-radius: 0 0 var(--bs-border-radius, 0.375rem) var(--bs-border-radius, 0.375rem);
    box-shadow: var(--bs-box-shadow, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
}

/* Dark mode support */
[data-bs-theme="dark"] .country-search-dropdown {
    background-color: var(--bs-dark, #212529);
    border-color: var(--bs-border-color-translucent, rgba(255, 255, 255, 0.15));
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
}

.country-search-dropdown.show {
    display: block;
}

.country-search-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.125));
    transition: background-color 0.15s ease-in-out;
    color: var(--bs-body-color, #212529);
}

/* Dark mode for items */
[data-bs-theme="dark"] .country-search-item {
    color: var(--bs-body-color, #dee2e6);
    border-bottom-color: var(--bs-border-color-translucent, rgba(255, 255, 255, 0.125));
}

.country-search-item:hover,
.country-search-item.highlighted {
    background-color: var(--bs-secondary-bg, #e9ecef);
}

/* Dark mode hover */
[data-bs-theme="dark"] .country-search-item:hover,
[data-bs-theme="dark"] .country-search-item.highlighted {
    background-color: var(--bs-secondary-bg, #495057);
}

.country-search-item:last-child {
    border-bottom: none;
}

.country-search-item.no-results {
    color: var(--bs-secondary, #6c757d);
    font-style: italic;
    cursor: default;
}

.country-search-item.no-results:hover {
    background-color: transparent;
}

.country-search-loading {
    padding: 0.5rem 0.75rem;
    color: var(--bs-secondary, #6c757d);
    text-align: center;
    font-style: italic;
}

.country-search-loading .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Input focus styles when dropdown is active using Bootstrap variables */
.country-search-container .form-control:focus {
    border-color: var(--bs-focus-ring-color, #86b7fe);
    outline: 0;
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color, rgba(13, 110, 253, 0.25));
}

.country-search-container .form-control.dropdown-active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Dark mode input focus */
[data-bs-theme="dark"] .country-search-container .form-control:focus {
    border-color: var(--bs-focus-ring-color, #86b7fe);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Scrollbar styling for dropdown with Bootstrap colors */
.country-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.country-search-dropdown::-webkit-scrollbar-track {
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.country-search-dropdown::-webkit-scrollbar-thumb {
    background: var(--bs-secondary, #6c757d);
    border-radius: 3px;
}

.country-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color, #495057);
}

/* Dark mode scrollbar */
[data-bs-theme="dark"] .country-search-dropdown::-webkit-scrollbar-track {
    background: var(--bs-tertiary-bg, #2b3035);
}

[data-bs-theme="dark"] .country-search-dropdown::-webkit-scrollbar-thumb {
    background: var(--bs-secondary, #adb5bd);
}

[data-bs-theme="dark"] .country-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--bs-light, #f8f9fa);
}

/* Additional Bootstrap utility classes support */
.country-search-dropdown .text-primary {
    color: var(--bs-primary, #0d6efd) !important;
}

.country-search-dropdown .text-muted {
    color: var(--bs-secondary, #6c757d) !important;
}

.country-search-dropdown .text-warning {
    color: var(--bs-warning, #ffc107) !important;
}

/* Dark mode text colors */
[data-bs-theme="dark"] .country-search-dropdown .text-primary {
    color: var(--bs-primary, #6ea8fe) !important;
}

[data-bs-theme="dark"] .country-search-dropdown .text-muted {
    color: var(--bs-secondary, #adb5bd) !important;
}

[data-bs-theme="dark"] .country-search-dropdown .text-warning {
    color: var(--bs-warning, #ffcd39) !important;
}

/* Responsive design - on mobile devices */
@media (max-width: 576px) {
    .country-search-dropdown {
        max-height: 150px;
        font-size: 0.875rem;
    }
    
    .country-search-item {
        padding: 0.375rem 0.5rem;
    }
}
