/* Country Dropdown Styles */
.country-dropdown-wrapper {
    position: relative;
}

/* Ensure country options are hidden when dropdown is closed */
.country-dropdown-menu:not(.show) .country-option {
    display: none !important;
}

.country-search-field {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%;
}

.country-search-field:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    cursor: text;
}

.country-search-field[readonly] {
    cursor: pointer;
}

.dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.8rem;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.country-dropdown-wrapper.open .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.country-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    z-index: 1050;
    display: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow: hidden;
}

.country-dropdown-menu.show {
    display: block !important;
}

.country-options {
    max-height: 250px;
    overflow-y: auto;
}

.country-option {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
    display: block;
    color: #333 !important;
    background-color: #fff !important;
}

.country-option:hover {
    background-color: #f8f9fa !important;
    color: #333 !important;
}

.country-option.selected {
    background-color: #d92e33 !important;
    color: white !important;
}

.country-option.selected:hover {
    background-color: #c1252a !important;
    color: white !important;
}

.country-option.highlighted {
    background-color: #e9ecef !important;
    color: #333 !important;
}

.country-option:last-child {
    border-bottom: none;
}

/* Hide scrollbar for webkit browsers */
.country-options::-webkit-scrollbar {
    width: 6px;
}

.country-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.country-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.country-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .country-dropdown-menu {
        max-height: 200px;
    }
    
    .country-options {
        max-height: 200px;
    }
    
    .country-option {
        padding: 12px;
        font-size: 0.9rem;
    }
}