/**
 * ROR Autocomplete Styles - Typeahead Style
 */

/* Main input wrapper should be positioned */
.ror-input-wrapper {
    position: relative;
}

/* Badge that appears next to the input after selection */
.ror-input-badge {
    display: none;
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.ror-input-badge .badge-ror {
    background-color: #21aaaa;
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ror-input-badge .badge-custom {
    background-color: #6c757d;
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
}

/* ============================================
   ROR Verification Info - Below Input Box
   ============================================ */

.ror-verification-info {
    display: none;
    margin-top: 5px;
    font-size: 11px;
}

.ror-badge-verified {
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ror-badge-verified i {
    font-size: 12px;
    color: #28a745;
}

.ror-badge-text {
    color: #666;
}

.ror-link {
    color: #21aaaa;
    text-decoration: none;
    font-weight: 500;
}

.ror-link:hover {
    text-decoration: underline;
    color: #1a8a8a;
}

.ror-badge-custom {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ror-badge-custom i {
    font-size: 14px;
}

/* Suggestions dropdown */
.ror-suggestions-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ror-suggestions-dropdown.show {
    display: block;
}

/* Individual suggestion item */
.ror-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.ror-suggestion-item:last-child {
    border-bottom: none;
}

.ror-suggestion-item:hover,
.ror-suggestion-item.highlighted {
    background-color: #f8f9fa;
}

.ror-suggestion-item.highlighted {
    background-color: #e9ecef;
}

/* Suggestion name */
.ror-suggestion-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

/* Suggestion country */
.ror-suggestion-country {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Loading indicator */
.ror-suggestions-dropdown .ror-loading {
    padding: 12px 14px;
    color: #666;
    font-style: italic;
    text-align: center;
}

.ror-loading i {
    margin-right: 6px;
}

/* ============================================
   Select2 Specific Styles for ROR Badge
   (Scoped under .ror-input-wrapper to avoid affecting other Select2 instances)
   ============================================ */

/* Style the badge inside Select2 selection - position to right */
.ror-input-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered .badge {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}

/* ROR badge color matching website theme */
.ror-input-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered .badge-success,
.ror-input-wrapper .select2-selection__rendered .badge.badge-success {
    background-color: #21aaaa !important;
    border: none;
    color: white !important;
}

/* Make selection container position relative for absolute badge */
.ror-input-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    position: relative;
}

/* Adjust Select2 arrow position */
.ror-input-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
    right: 5px;
}

/* Ensure proper height and alignment */
.ror-input-wrapper .select2-container--default .select2-selection--single {
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.ror-input-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
}

/* Focus state with website theme color */
.ror-input-wrapper .select2-container--default.select2-container--focus .select2-selection--single,
.ror-input-wrapper .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #21aaaa;
    box-shadow: 0 0 0 0.2rem rgba(33, 170, 170, 0.25);
}

/* Dropdown hover highlight with theme color */
.ror-input-wrapper .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #21aaaa;
}

/* Hide redundant search box inside dropdown */
.ror-input-wrapper .select2-container--default .select2-search--dropdown {
    display: none;
}

/* Dropdown styling */
.ror-input-wrapper .select2-dropdown {
    border-color: #ced4da;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}