/* Sélecteur de pays moderne avec drapeaux */
.modern-country-select {
    position: relative;
    width: 100%;
}

.modern-country-select .form-select {
    appearance: none;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    z-index: 10;
}

.modern-country-select .form-select:hover {
    border-color: #9ca3af;
}

.modern-country-select .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dropdown personnalisé */
.modern-country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.modern-country-dropdown.show {
    display: block;
}

/* Barre de recherche */
.modern-country-search {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.modern-country-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease-in-out;
}

.modern-country-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Liste des pays */
.modern-country-list {
    max-height: 250px;
    overflow-y: auto;
}

.modern-country-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

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

.modern-country-option:hover {
    background-color: #f9fafb;
}

.modern-country-option.selected {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.modern-country-option .flag {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.modern-country-option .name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Pays préférés */
.modern-country-preferred {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.modern-country-preferred .modern-country-option {
    font-weight: 600;
}

/* Indicateur de sélection */
.modern-country-select .selected-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.modern-country-select .selected-display:hover {
    border-color: #9ca3af;
}

.modern-country-select .selected-display:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-country-select .selected-display .flag {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.modern-country-select .selected-display .name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.modern-country-select .selected-display .placeholder {
    color: #9ca3af;
    font-style: italic;
}

.modern-country-select .selected-display .arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #6b7280;
    transition: transform 0.2s ease-in-out;
    flex-shrink: 0;
}

.modern-country-select.open .selected-display .arrow {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 640px) {
    .modern-country-dropdown {
        max-height: 250px;
    }
    
    .modern-country-option {
        padding: 0.875rem 1rem;
    }
    
    .modern-country-option .flag {
        font-size: 1.125rem;
    }
}

/* Animation d'apparition */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-country-dropdown.show {
    animation: slideDown 0.2s ease-out;
}

/* Scrollbar personnalisée */
.modern-country-list::-webkit-scrollbar {
    width: 6px;
}

.modern-country-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modern-country-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modern-country-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* États de chargement */
.modern-country-select.loading .selected-display::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Masquer le select natif */
.modern-country-select .form-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
} 